iio: adc: tsc2046: fix scan interval warning
authorOleksij Rempel <o.rempel@pengutronix.de>
Thu, 7 Oct 2021 09:30:06 +0000 (11:30 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 17 Oct 2021 16:23:17 +0000 (17:23 +0100)
Sync if statement with the actual warning.

Fixes: 9504db5765e8 ("iio: adc: tsc2046: fix a warning message in tsc2046_adc_update_scan_mode()")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.kernel.org/r/20211007093007.1466-2-o.rempel@pengutronix.de
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ti-tsc2046.c

index 170950d5dd499101384f4e7f9d8cf52b09172ec9..d84ae6b008c1b024a55d4f1bf670e73ec20cd232 100644 (file)
@@ -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)
+       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);