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

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

 




> -----Original Message-----
> From: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> Sent: Monday, August 16, 2021 10:10 AM
> To: Sa, Nuno <Nuno.Sa@xxxxxxxxxx>
> Cc: Jonathan Cameron <jic23@xxxxxxxxxx>; Rob Herring
> <robh+dt@xxxxxxxxxx>; linux-iio <linux-iio@xxxxxxxxxxxxxxx>;
> Hennerich, Michael <Michael.Hennerich@xxxxxxxxxx>; Lars-Peter
> Clausen <lars@xxxxxxxxxx>
> Subject: Re: [PATCH] iio: ad5770r: make devicetree property reading
> consistent
> 
> On Mon, Aug 16, 2021 at 10:54 AM Sa, Nuno <Nuno.Sa@xxxxxxxxxx>
> wrote:
> 
> ...
> 
> > Well, It seems we need to go through the support both 'num' and
> 'reg'
> > route... I did some git blaming and it turns out 'num' was actually
> supported
> > in the bindings [1]. After some time it was replaced by 'reg' [2]
> leaving the
> > driver unchanged... I guess we have a significant window of time
> here
> > where someone could deploy a *validated* devicetree using 'num'...
> > If no objections, on v2 I will just try to get 'reg' and if not present,
> fallback
> > to 'num' before erroring out.
> 
> Ouch, thanks for digging this out!
> 
> So, it means the following:
> 1) add "num" as _obsolete_ property to DT bindings
> 2) add support of "reg" to the driver
> 
> > [1]:
> https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/k
> ernel/git/torvalds/linux.git/commit/?id=ea52c21268e68cfdc1aabe686b
> 154d73d8bf4d7e__;!!A3Ni8CS0y2Y!pXYlkekser2PGbqrJZWpCXQ0oxp4
> OUNdOpRl03X9jRhgrj-jPaE_WB7hsAWEAA$
> > [2]:
> https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/k
> ernel/git/torvalds/linux.git/commit/?id=2cf3818f18b26992ff20a730df4
> 6e08e2485fd67__;!!A3Ni8CS0y2Y!pXYlkekser2PGbqrJZWpCXQ0oxp4O
> UNdOpRl03X9jRhgrj-jPaE_WB7e_v1D4g$
> 
> --
> With Best Regards,

Hi Rob,

As Andy suggested I'm trying to add the 'num' property back to the bindings
with a 'deprecated: true' value for the property. I was trying to get something
like (the main idea is to have either ref or num defined):

channel@0:
...
  properties:
    - oneof:
        - reg:
            ...
        - num:
            /* not sure if it makes sense to give the same values (description and possible values)
                 as for 'reg' */
            deprecated: true

However, I'm failing to get pass through validations. Is there a way to make this a oneOf as I'm
trying to? I'm feeling that these channel nodes should have a required key where we could use
oneOf 

Moreover, it seems that the validation enforces the 'reg' or 'ranges' for channel nodes
like this (maybe the fix [1] was actually because of this) so I wonder about my statement of
anyone having "validated" devicetrees with the old 'num' property...

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2cf3818f18b26992ff20a730df46e08e2485fd67
- 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