iio: accel: bma400: prevent setting accel scale too low
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 16 Jan 2020 10:08:29 +0000 (13:08 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 18 Jan 2020 13:33:11 +0000 (13:33 +0000)
commit98496ccdf0dd88696203e69542e07ef824c56ead
treef6aa2016245b1dcd64f58ef787f7385e7ea24079
parent84961af78c509d500b9b4a45989e449f048c821a
iio: accel: bma400: prevent setting accel scale too low

This puts an upper bound on "val2" but it also needs to have a lower
bound (BMA400_SCALE_MIN).

Fixes: 465c811f1f20 ("iio: accel: Add driver for the BMA400")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/bma400_core.c