All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] iio: ad5770r: make devicetree property reading consistent
@ 2021-08-18  8:05 Nuno Sá
  2021-08-18  9:54 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Nuno Sá @ 2021-08-18  8:05 UTC (permalink / raw)
  To: linux-iio; +Cc: Jonathan Cameron, Michael Hennerich, Lars-Peter Clausen

The bindings file for this driver is defining the property as 'reg' but
the driver was reading it with the 'num' name. The bindings actually had
the 'num' property when added in
commit ea52c21268e6 ("dt-bindings: iio: dac: Add docs for AD5770R DAC")
and then changed it to 'reg' in
commit 2cf3818f18b2 ("dt-bindings: iio: dac: AD5570R fix bindings errors").
However, both these commits landed in v5.7 so the assumption is
that either 'num' is not being used or if it is, the validations were not
done.

Anyways, if someone comes back yelling about this, we might just support
both of the properties in the future. Not ideal, but that's life...

Fixes: 2cf3818f18b2 ("dt-bindings: iio: dac: AD5570R fix bindings errors")
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
---
v2:
 * Updated the commit description and added a fixes tag.

 drivers/iio/dac/ad5770r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/dac/ad5770r.c b/drivers/iio/dac/ad5770r.c
index 8107f7bbbe3c..7e2fd32e993a 100644
--- a/drivers/iio/dac/ad5770r.c
+++ b/drivers/iio/dac/ad5770r.c
@@ -522,7 +522,7 @@ static int ad5770r_channel_config(struct ad5770r_state *st)
 		return -EINVAL;
 
 	device_for_each_child_node(&st->spi->dev, child) {
-		ret = fwnode_property_read_u32(child, "num", &num);
+		ret = fwnode_property_read_u32(child, "reg", &num);
 		if (ret)
 			goto err_child_out;
 		if (num >= AD5770R_MAX_CHANNELS) {
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] iio: ad5770r: make devicetree property reading consistent
  2021-08-18  8:05 [PATCH v2] iio: ad5770r: make devicetree property reading consistent Nuno Sá
@ 2021-08-18  9:54 ` Andy Shevchenko
  2021-08-29 17:05   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2021-08-18  9:54 UTC (permalink / raw)
  To: Nuno Sá
  Cc: linux-iio, Jonathan Cameron, Michael Hennerich, Lars-Peter Clausen

On Wed, Aug 18, 2021 at 11:05 AM Nuno Sá <nuno.sa@analog.com> wrote:
>
> The bindings file for this driver is defining the property as 'reg' but
> the driver was reading it with the 'num' name. The bindings actually had
> the 'num' property when added in
> commit ea52c21268e6 ("dt-bindings: iio: dac: Add docs for AD5770R DAC")
> and then changed it to 'reg' in
> commit 2cf3818f18b2 ("dt-bindings: iio: dac: AD5570R fix bindings errors").
> However, both these commits landed in v5.7 so the assumption is
> that either 'num' is not being used or if it is, the validations were not
> done.
>
> Anyways, if someone comes back yelling about this, we might just support
> both of the properties in the future. Not ideal, but that's life...

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Fixes: 2cf3818f18b2 ("dt-bindings: iio: dac: AD5570R fix bindings errors")
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> ---
> v2:
>  * Updated the commit description and added a fixes tag.
>
>  drivers/iio/dac/ad5770r.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/dac/ad5770r.c b/drivers/iio/dac/ad5770r.c
> index 8107f7bbbe3c..7e2fd32e993a 100644
> --- a/drivers/iio/dac/ad5770r.c
> +++ b/drivers/iio/dac/ad5770r.c
> @@ -522,7 +522,7 @@ static int ad5770r_channel_config(struct ad5770r_state *st)
>                 return -EINVAL;
>
>         device_for_each_child_node(&st->spi->dev, child) {
> -               ret = fwnode_property_read_u32(child, "num", &num);
> +               ret = fwnode_property_read_u32(child, "reg", &num);
>                 if (ret)
>                         goto err_child_out;
>                 if (num >= AD5770R_MAX_CHANNELS) {
> --
> 2.32.0
>


-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] iio: ad5770r: make devicetree property reading consistent
  2021-08-18  9:54 ` Andy Shevchenko
@ 2021-08-29 17:05   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2021-08-29 17:05 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Nuno Sá, linux-iio, Michael Hennerich, Lars-Peter Clausen

On Wed, 18 Aug 2021 12:54:09 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Wed, Aug 18, 2021 at 11:05 AM Nuno Sá <nuno.sa@analog.com> wrote:
> >
> > The bindings file for this driver is defining the property as 'reg' but
> > the driver was reading it with the 'num' name. The bindings actually had
> > the 'num' property when added in
> > commit ea52c21268e6 ("dt-bindings: iio: dac: Add docs for AD5770R DAC")
> > and then changed it to 'reg' in
> > commit 2cf3818f18b2 ("dt-bindings: iio: dac: AD5570R fix bindings errors").
> > However, both these commits landed in v5.7 so the assumption is
> > that either 'num' is not being used or if it is, the validations were not
> > done.
> >
> > Anyways, if someone comes back yelling about this, we might just support
> > both of the properties in the future. Not ideal, but that's life...  
> 
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Given the potential issues on this I want it to sit in next for a while. As such
I'm applying it via the slow path rather than the quick one.  It'll sit in next
for most of a cycle before the merge window in 3 months time.

Hopefully anyone who has fallen in the gap is doing tests! (seems unlikely but
they can't claim we didn't give them time to notice ;)

Applied to the togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

> 
> > Fixes: 2cf3818f18b2 ("dt-bindings: iio: dac: AD5570R fix bindings errors")
> > Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> > ---
> > v2:
> >  * Updated the commit description and added a fixes tag.
> >
> >  drivers/iio/dac/ad5770r.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/dac/ad5770r.c b/drivers/iio/dac/ad5770r.c
> > index 8107f7bbbe3c..7e2fd32e993a 100644
> > --- a/drivers/iio/dac/ad5770r.c
> > +++ b/drivers/iio/dac/ad5770r.c
> > @@ -522,7 +522,7 @@ static int ad5770r_channel_config(struct ad5770r_state *st)
> >                 return -EINVAL;
> >
> >         device_for_each_child_node(&st->spi->dev, child) {
> > -               ret = fwnode_property_read_u32(child, "num", &num);
> > +               ret = fwnode_property_read_u32(child, "reg", &num);
> >                 if (ret)
> >                         goto err_child_out;
> >                 if (num >= AD5770R_MAX_CHANNELS) {
> > --
> > 2.32.0
> >  
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-29 17:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18  8:05 [PATCH v2] iio: ad5770r: make devicetree property reading consistent Nuno Sá
2021-08-18  9:54 ` Andy Shevchenko
2021-08-29 17:05   ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.