Re: [PATCH 2/2] iio:adc:ad7124: Convert to fwnode handling of child node parsing.

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

 



On Sun, 25 Jul 2021 23:33:12 +0300
Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote:

> On Sun, Jul 25, 2021 at 8:22 PM Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
> >
> > Also use device_get_match_data() rather than of specific variant.
> > These changes enable use of this binding on ACPI platforms via PRP0001.
> > Whilst it's possible no one will ever do so, this is part of a general
> > effort to clear out examples from IIO that might be copied into new
> > drivers.
> >
> > It may appear that this change drops the check for status = disabled,
> > but in reality it does not because the of property code uses
> > of_get_next_available_child().  This driver may well fail to probe
> > if disabled is ever actually set though due to the need for
> > complete concurrent child nodes.  A future series might resolve
> > that restriction.  
> 
> Perhaps we need to have
> 
> ...
> 
> > +       device_for_each_child_node(dev, child)
> > +               st->num_channels++;
> > +  
> 
> device_get_child_node_count() ?
> 

Gah. Not sure how I missed that one when looking for it...

> ...
> 
> > -       for_each_available_child_of_node(np, child) {
> > +       device_for_each_child_node(dev, child) {  
> 
> Isn't this
>   fwnode_for_each_available_child_node()
> better to use?

Given we would be extracting the fwnode just to call this
loop, I'd say no, device version makes more sense..

> 
> ...
> 
> So the gaps I see are
>   device_get_available_child_node_count()
> and
>   device_for_each_available_child_node()

Do we then fix the fact that
device_for_each_child_node() will call the _available() form
for device tree?  That seems inconsistent currently and
I was assuming that was deliberate...

Jonathan


> 
> Both of them I think are easy to add and avoid possible breakage.
> 




[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