diff mbox series

[v2,1/2] iio: adc: tsc2046: fix scan interval warning

Message ID 20211007093007.1466-2-o.rempel@pengutronix.de (mailing list archive)
State Accepted
Headers show
Series iio: adc: tsc2046: fixes | expand

Commit Message

Oleksij Rempel Oct. 7, 2021, 9:30 a.m. UTC
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>
---
 drivers/iio/adc/ti-tsc2046.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jonathan Cameron Oct. 17, 2021, 4:24 p.m. UTC | #1
On Thu,  7 Oct 2021 11:30:06 +0200
Oleksij Rempel <o.rempel@pengutronix.de> wrote:

> 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>
Applied this one to the fixes-togreg branch of iio.git and marked it for stable.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ti-tsc2046.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c
> index 170950d5dd49..d84ae6b008c1 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)
> +	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);
>
diff mbox series

Patch

diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c
index 170950d5dd49..d84ae6b008c1 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)
+	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);