iio: chemical: bme680: Add check for val2 in the write_raw function
authorHimanshu Jha <himanshujha199640@gmail.com>
Sat, 11 Aug 2018 10:26:36 +0000 (15:56 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Aug 2018 19:07:25 +0000 (20:07 +0100)
commit892e62fab4983656d3ca5df4e83fdf2b496c06e4
treeae9ed0ca9d8c9cf9012f34ac5bbc2561e8d9205b
parent010de20412fc40dabfbab926358ecd9c4486dd0d
iio: chemical: bme680: Add check for val2 in the write_raw function

val2 is responsible for the floating part of the number to be
written to the device. We don't need the floating part
while writing the oversampling ratio for BME680 since the
available oversampling ratios are pure natural numbers.

So, add a sanity check to make sure val2 is 0.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/chemical/bme680_core.c