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, 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() ?

...

> -       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?

...

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

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

-- 
With Best Regards,
Andy Shevchenko



[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