RE: [PATCH] iio: ad5770r: make devicetree property reading consistent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Rob Herring <robh+dt@xxxxxxxxxx>
> Sent: Thursday, August 12, 2021 5:11 PM
> To: Sa, Nuno <Nuno.Sa@xxxxxxxxxx>
> Cc: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>; linux-iio
> <linux-iio@xxxxxxxxxxxxxxx>; Jonathan Cameron <jic23@xxxxxxxxxx>;
> Hennerich, Michael <Michael.Hennerich@xxxxxxxxxx>; Lars-Peter
> Clausen <lars@xxxxxxxxxx>
> Subject: Re: [PATCH] iio: ad5770r: make devicetree property reading
> consistent
> 
> On Thu, Aug 12, 2021 at 3:14 AM Sa, Nuno <Nuno.Sa@xxxxxxxxxx>
> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> > > Sent: Thursday, August 12, 2021 9:06 AM
> > > To: Sa, Nuno <Nuno.Sa@xxxxxxxxxx>
> > > Cc: linux-iio <linux-iio@xxxxxxxxxxxxxxx>; Jonathan Cameron
> > > <jic23@xxxxxxxxxx>; Hennerich, Michael
> > > <Michael.Hennerich@xxxxxxxxxx>; Lars-Peter Clausen
> > > <lars@xxxxxxxxxx>
> > > Subject: Re: [PATCH] iio: ad5770r: make devicetree property
> reading
> > > consistent
> > >
> > >
> > >
> > > On Thursday, August 12, 2021, Sa, Nuno <Nuno.Sa@xxxxxxxxxx
> > > <mailto:Nuno.Sa@xxxxxxxxxx> > wrote:
> > >
> > >
> > >       > From: Andy Shevchenko <andy.shevchenko@xxxxxxxxx
> > > <mailto:andy.shevchenko@xxxxxxxxx> >
> > >       > Sent: Wednesday, August 11, 2021 6:04 PM
> > >       > To: Sa, Nuno <Nuno.Sa@xxxxxxxxxx
> > > <mailto:Nuno.Sa@xxxxxxxxxx> >
> > >       > Cc: linux-iio <linux-iio@xxxxxxxxxxxxxxx <mailto:linux-
> > > iio@xxxxxxxxxxxxxxx> >; Jonathan Cameron
> > >       > <jic23@xxxxxxxxxx <mailto:jic23@xxxxxxxxxx> >; Hennerich,
> > > Michael
> > >       > <Michael.Hennerich@xxxxxxxxxx
> > > <mailto:Michael.Hennerich@xxxxxxxxxx> >; Lars-Peter Clausen
> > >       > <lars@xxxxxxxxxx <mailto:lars@xxxxxxxxxx> >
> > >       > Subject: Re: [PATCH] iio: ad5770r: make devicetree property
> > > reading
> > >       > consistent
> > >       >
> > >       > On Wed, Aug 11, 2021 at 10:46 AM Nuno Sá
> > > <nuno.sa@xxxxxxxxxx <mailto:nuno.sa@xxxxxxxxxx> >
> > >       > wrote:
> > >       > >
> > >       > > The bindings file for this driver is defining the property as
> > > 'reg' but
> > >       > > the driver was reading it with the 'num' name. This patches
> > > makes
> > >       > the
> > >       >
> > >       > "This patches makes the..." --> "Make the..."
> > >       >
> > >       > > driver consistent with what is defined in the bindings.
> > >       >
> > >       > While it seems okay, it may be now a chicken-egg issue
> > > (somebody
> > >       > created a DT with "num" property).
> > >       >
> > >
> > >       Arghh, I see. Well, maybe let's go the other way around and
> > > change the
> > >       bindings doc to 'num'?
> > >
> > >
> > > Not sure, like I said it’s a chicken-egg issue. Consult with Rob
> perhaps?
> >
> > Hi Rob,
> >
> > Could you give your input on this one?
> 
> There's no context, but I'm assuming this is in channel nodes. Keep

Sorry about that. Your assumption is correct, the binding is for a channel
node [1]. The driver just get's it as 'num' [2] which is not consistent.
Naively, I just though changing the driver to use reg would be enough
but Andy nicely raised the question of someone being already relying
on 'num'...

> the binding 'reg' and make the driver support both if needed.
> Considering the author of the binding also changed the binding from
> num to reg shortly after adding the binding, I don't think 'num'
> support is needed. If someone used 'num' and didn't run validation,
> well, that's their problem.
> 

So I guess the solution here is just to change the driver to support both
reg and num.

[1]: https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/iio/dac/adi,ad5770r.yaml#L67
[2]: https://elixir.bootlin.com/linux/latest/source/drivers/iio/dac/ad5770r.c#L525

- Nuno Sá




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux