diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-11 19:30:50 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-11 19:30:50 +0300 |
commit | 5f47992491ffe2d5b2b4ea3556bc0f3c0ec9bc8b (patch) | |
tree | f43f81ab67d152c148bd3dfc1a0683d2c8306014 /drivers/iio/accel | |
parent | 148e45dc87cb76ba89e80da264bc692cc91a5149 (diff) | |
parent | bf16200689118d19de1b8d2a3c314fc21f5dc7bb (diff) | |
download | linux-5f47992491ffe2d5b2b4ea3556bc0f3c0ec9bc8b.tar.xz |
Merge 4.6-rc3 into staging-next
This resolves a lot of merge issues with PAGE_CACHE_* changes, and an
iio driver merge issue.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/accel')
-rw-r--r-- | drivers/iio/accel/bmc150-accel-core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index e631ee9a6a77..2a0735d6955d 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -548,7 +548,7 @@ static int bmc150_accel_get_axis(struct bmc150_accel_data *data, { int ret; int axis = chan->scan_index; - unsigned int raw_val; + __le16 raw_val; mutex_lock(&data->mutex); ret = bmc150_accel_set_power_state(data, true); @@ -558,14 +558,14 @@ static int bmc150_accel_get_axis(struct bmc150_accel_data *data, } ret = regmap_bulk_read(data->regmap, BMC150_ACCEL_AXIS_TO_REG(axis), - &raw_val, 2); + &raw_val, sizeof(raw_val)); if (ret < 0) { dev_err(data->dev, "Error reading axis %d\n", axis); bmc150_accel_set_power_state(data, false); mutex_unlock(&data->mutex); return ret; } - *val = sign_extend32(raw_val >> chan->scan_type.shift, + *val = sign_extend32(le16_to_cpu(raw_val) >> chan->scan_type.shift, chan->scan_type.realbits - 1); ret = bmc150_accel_set_power_state(data, false); mutex_unlock(&data->mutex); |