diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-24 11:50:13 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-24 11:50:13 +0300 |
commit | 8b77eb97f7847d67129d5312596e953bd7946f48 (patch) | |
tree | 754eca1f2ca367b93cead00c4135056b4ab9fcbe /drivers/iio/chemical/atlas-ph-sensor.c | |
parent | c89d98e224b4858f42a9fec0f16766b3d7669ba3 (diff) | |
parent | 64bc2d02d754f4143d65cc21c644176db12ab5c8 (diff) | |
download | linux-8b77eb97f7847d67129d5312596e953bd7946f48.tar.xz |
Merge tag 'iio-fixes-for-4.9a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes:
First set of IIO fixes for the 4.9 cycle.
* atlas chemical
- Fix alignment of big endian values in a larger storage (by using the right
size storage)
* maxim thermocouple
- Fix alignment of big endian values in larger (by using the correct
sized storage).
* sca3000
- Handle unexpected mode values.
* ti-adc081
- Select IIO_TRIGGERED_BUFFER to avoid build errors
Diffstat (limited to 'drivers/iio/chemical/atlas-ph-sensor.c')
-rw-r--r-- | drivers/iio/chemical/atlas-ph-sensor.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/iio/chemical/atlas-ph-sensor.c b/drivers/iio/chemical/atlas-ph-sensor.c index bd321b305a0a..ef761a508630 100644 --- a/drivers/iio/chemical/atlas-ph-sensor.c +++ b/drivers/iio/chemical/atlas-ph-sensor.c @@ -213,13 +213,14 @@ static int atlas_check_ec_calibration(struct atlas_data *data) struct device *dev = &data->client->dev; int ret; unsigned int val; + __be16 rval; - ret = regmap_bulk_read(data->regmap, ATLAS_REG_EC_PROBE, &val, 2); + ret = regmap_bulk_read(data->regmap, ATLAS_REG_EC_PROBE, &rval, 2); if (ret) return ret; - dev_info(dev, "probe set to K = %d.%.2d", be16_to_cpu(val) / 100, - be16_to_cpu(val) % 100); + val = be16_to_cpu(rval); + dev_info(dev, "probe set to K = %d.%.2d", val / 100, val % 100); ret = regmap_read(data->regmap, ATLAS_REG_EC_CALIB_STATUS, &val); if (ret) |