diff mbox series

[v2,1/6] iio: adc: mp2629: fix wrong comparison of channel

Message ID 20220614194225.2226447-1-sravanhome@gmail.com (mailing list archive)
State Superseded
Headers show
Series [v2,1/6] iio: adc: mp2629: fix wrong comparison of channel | expand

Commit Message

saravanan sekar June 14, 2022, 7:42 p.m. UTC
Input voltage channel enum is compared against iio address instead
of channel.

Fixes: 7abd9fb64682 ("iio: adc: mp2629: Add support for mp2629 ADC driver")
Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
---
 drivers/iio/adc/mp2629_adc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko June 15, 2022, 9:53 a.m. UTC | #1
On Tue, Jun 14, 2022 at 9:42 PM Saravanan Sekar <sravanhome@gmail.com> wrote:
>
> Input voltage channel enum is compared against iio address instead
> of channel.

the channel

...

I do not see a cover letter, but FWIW,
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
for all patches except DT binding
Note, some of the comments regarding spelling were given, I believe
you are going to address them in v3.

> Fixes: 7abd9fb64682 ("iio: adc: mp2629: Add support for mp2629 ADC driver")
> Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
> ---
>  drivers/iio/adc/mp2629_adc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/mp2629_adc.c b/drivers/iio/adc/mp2629_adc.c
> index aca084f1e78a..e7fbfe92e884 100644
> --- a/drivers/iio/adc/mp2629_adc.c
> +++ b/drivers/iio/adc/mp2629_adc.c
> @@ -73,7 +73,7 @@ static int mp2629_read_raw(struct iio_dev *indio_dev,
>                 if (ret)
>                         return ret;
>
> -               if (chan->address == MP2629_INPUT_VOLT)
> +               if (chan->channel == MP2629_INPUT_VOLT)
>                         rval &= GENMASK(6, 0);
>                 *val = rval;
>                 return IIO_VAL_INT;
> --
> 2.25.1
>
diff mbox series

Patch

diff --git a/drivers/iio/adc/mp2629_adc.c b/drivers/iio/adc/mp2629_adc.c
index aca084f1e78a..e7fbfe92e884 100644
--- a/drivers/iio/adc/mp2629_adc.c
+++ b/drivers/iio/adc/mp2629_adc.c
@@ -73,7 +73,7 @@  static int mp2629_read_raw(struct iio_dev *indio_dev,
 		if (ret)
 			return ret;
 
-		if (chan->address == MP2629_INPUT_VOLT)
+		if (chan->channel == MP2629_INPUT_VOLT)
 			rval &= GENMASK(6, 0);
 		*val = rval;
 		return IIO_VAL_INT;