2024-04-04 07:32:07

by Dan Carpenter

[permalink] [raw]
Subject: [PATCH] iio: adc: ad7173: Fix ! vs ~ typo in ad7173_sel_clk()

This was obviously supposed to be a bitwise negate instead of logical.

Fixes: 76a1e6a42802 ("iio: adc: ad7173: add AD7173 driver")
Signed-off-by: Dan Carpenter <[email protected]>
---
drivers/iio/adc/ad7173.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c
index 4ff6ce46b02c..b1d6ea17ced3 100644
--- a/drivers/iio/adc/ad7173.c
+++ b/drivers/iio/adc/ad7173.c
@@ -835,7 +835,7 @@ static unsigned long ad7173_sel_clk(struct ad7173_state *st,
{
int ret;

- st->adc_mode &= !AD7173_ADC_MODE_CLOCKSEL_MASK;
+ st->adc_mode &= ~AD7173_ADC_MODE_CLOCKSEL_MASK;
st->adc_mode |= FIELD_PREP(AD7173_ADC_MODE_CLOCKSEL_MASK, clk_sel);
ret = ad_sd_write_reg(&st->sd, AD7173_REG_ADC_MODE, 0x2, st->adc_mode);

--
2.43.0



2024-04-04 09:00:11

by Nuno Sá

[permalink] [raw]
Subject: Re: [PATCH] iio: adc: ad7173: Fix ! vs ~ typo in ad7173_sel_clk()

On Thu, 2024-04-04 at 10:31 +0300, Dan Carpenter wrote:
> This was obviously supposed to be a bitwise negate instead of logical.
>
> Fixes: 76a1e6a42802 ("iio: adc: ad7173: add AD7173 driver")
> Signed-off-by: Dan Carpenter <[email protected]>
> ---

Reviewed-by: Nuno Sa <[email protected]>

>  drivers/iio/adc/ad7173.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c
> index 4ff6ce46b02c..b1d6ea17ced3 100644
> --- a/drivers/iio/adc/ad7173.c
> +++ b/drivers/iio/adc/ad7173.c
> @@ -835,7 +835,7 @@ static unsigned long ad7173_sel_clk(struct ad7173_state
> *st,
>  {
>   int ret;
>  
> - st->adc_mode &= !AD7173_ADC_MODE_CLOCKSEL_MASK;
> + st->adc_mode &= ~AD7173_ADC_MODE_CLOCKSEL_MASK;
>   st->adc_mode |= FIELD_PREP(AD7173_ADC_MODE_CLOCKSEL_MASK, clk_sel);
>   ret = ad_sd_write_reg(&st->sd, AD7173_REG_ADC_MODE, 0x2, st-
> >adc_mode);
>  


2024-04-06 15:44:44

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH] iio: adc: ad7173: Fix ! vs ~ typo in ad7173_sel_clk()

On Thu, 04 Apr 2024 11:03:29 +0200
Nuno Sá <[email protected]> wrote:

> On Thu, 2024-04-04 at 10:31 +0300, Dan Carpenter wrote:
> > This was obviously supposed to be a bitwise negate instead of logical.
> >
> > Fixes: 76a1e6a42802 ("iio: adc: ad7173: add AD7173 driver")
> > Signed-off-by: Dan Carpenter <[email protected]>
> > ---
>
> Reviewed-by: Nuno Sa <[email protected]>
>
Applied.

Thanks,

> >  drivers/iio/adc/ad7173.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c
> > index 4ff6ce46b02c..b1d6ea17ced3 100644
> > --- a/drivers/iio/adc/ad7173.c
> > +++ b/drivers/iio/adc/ad7173.c
> > @@ -835,7 +835,7 @@ static unsigned long ad7173_sel_clk(struct ad7173_state
> > *st,
> >  {
> >   int ret;
> >  
> > - st->adc_mode &= !AD7173_ADC_MODE_CLOCKSEL_MASK;
> > + st->adc_mode &= ~AD7173_ADC_MODE_CLOCKSEL_MASK;
> >   st->adc_mode |= FIELD_PREP(AD7173_ADC_MODE_CLOCKSEL_MASK, clk_sel);
> >   ret = ad_sd_write_reg(&st->sd, AD7173_REG_ADC_MODE, 0x2, st-
> > >adc_mode);
> >  
>