aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/ti-tsc2046.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-05-15 12:51:52 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-06-03 18:24:12 +0100
commit9504db5765e83cc919caf6647725f7d022874c9d (patch)
treeca096b81b597058f4e3d30479fb7404127fc47c0 /drivers/iio/adc/ti-tsc2046.c
parentiio: light: tsl2591: delete a stray tab (diff)
downloadlinux-dev-9504db5765e83cc919caf6647725f7d022874c9d.tar.xz
linux-dev-9504db5765e83cc919caf6647725f7d022874c9d.zip
iio: adc: tsc2046: fix a warning message in tsc2046_adc_update_scan_mode()
These variables are unsigned so the condition can't be less than zero and the warning message will never be printed. Fixes: 9374e8f5a38d ("iio: adc: add ADC driver for the TI TSC2046 controller") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/YJ+ZuO43TnguY5vq@mwanda Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/ti-tsc2046.c')
-rw-r--r--drivers/iio/adc/ti-tsc2046.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c
index 89a818b653b4..cf5373d5cdd7 100644
--- a/drivers/iio/adc/ti-tsc2046.c
+++ b/drivers/iio/adc/ti-tsc2046.c
@@ -398,7 +398,7 @@ static int tsc2046_adc_update_scan_mode(struct iio_dev *indio_dev,
priv->xfer.len = size;
priv->time_per_scan_us = size * 8 * priv->time_per_bit_ns / NSEC_PER_USEC;
- if ((priv->scan_interval_us - priv->time_per_scan_us) < 0)
+ if (priv->scan_interval_us > priv->time_per_scan_us)
dev_warn(&priv->spi->dev, "The scan interval (%d) is less then calculated scan time (%d)\n",
priv->scan_interval_us, priv->time_per_scan_us);