mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
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: 9374e8f5a3
("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>
This commit is contained in:
parent
2989df460c
commit
9504db5765
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue