static ssize_t bma250_fast_calibration_y_show(struct device *dev, struct device_attribute *attr, char *buf) { struct i2c_client *client = to_i2c_client(dev); struct bma250_data *bma250 = i2c_get_clientdata(client); return sprintf(buf, "%d\n", atomic_read(&bma250->fast_calib_y_rslt)); #if 0 if (bma250_get_offset_target_y(bma250->bma250_client, &data) < 0) return sprintf(buf, "Read error\n"); return sprintf(buf, "%d\n", data); #endif }
static ssize_t bma250_fast_calibration_y_show(struct device *dev, struct device_attribute *attr, char *buf) { unsigned char data; struct i2c_client *client = to_i2c_client(dev); struct bma250_data *bma250 = i2c_get_clientdata(client); if (bma250_get_offset_target_y(bma250->bma250_client, &data) < 0) return sprintf(buf, "Read error\n"); return sprintf(buf, "%d\n", data); }
unsigned char bma250_get_fast_calibration_y(struct i2c_client *client) { return bma250_get_offset_target_y(client); }