Re: [RFC PATCH 4/6] iio: inkern: split of_iio_channel_get_by_name()

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

 



On Thu, Jun 2, 2022 at 4:04 PM Nuno Sá <nuno.sa@xxxxxxxxxx> wrote:
>
> This change splits of_iio_channel_get_by_name() so that it decouples
> looking for channels in the current node from looking in it's parents
> nodes. This will be helpful when moving to fwnode properties where we
> need to release the handles when looking for channels in parent's nodes.

...

> +       /*
> +        * For named iio channels, first look up the name in the
> +        * "io-channel-names" property.  If it cannot be found, the
> +        * index will be an error code, and of_iio_channel_get()
> +        * will fail.
> +        */
> +       if (name)
> +               index = of_property_match_string(np, "io-channel-names", name);
> +
> +       chan = of_iio_channel_get(np, index);
> +       if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) {
> +               *parent_lookup = false;
> +       } else if (name && index >= 0) {

> +               pr_err("ERROR: could not get IIO channel %pOF:%s(%i)\n",
> +                      np, name ? name : "", index);

It's one TAB less now, means you may compress more on one line,
including replacing
name ? name : "" --> name ?: ""

> +               *parent_lookup = false;
> +       }

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