diff --git a/drivers/staging/iio/imu/adis16400_core.c b/drivers/staging/iio/imu/adis16400_core.c index 9c8f5ab7e13bec8a8761eef34eb600ff7e88f89f..cb6622578e9bfa81567ab3fff641f4baaa5310e5 100644 --- a/drivers/staging/iio/imu/adis16400_core.c +++ b/drivers/staging/iio/imu/adis16400_core.c @@ -178,7 +178,11 @@ static int adis16334_set_freq(struct iio_dev *indio_dev, unsigned int freq) { unsigned int t; - t = ilog2(8192 / (freq * 10)); + freq *= 10; + if (freq < 8192) + t = ilog2(8192 / freq); + else + t = 0; if (t > 0x31) t = 0x31;