Re: [PATCH v2 2/2] iio: adc: ti-ads1015: Add support for label
From: Andy Shevchenko
Date: Thu Sep 03 2026 - 02:20:18 EST
On Wed, Sep 02, 2026 at 01:37:45PM -0500, David Lechner wrote:
> On 9/2/26 12:22 PM, Flaviu Nistor wrote:
...
> > + if (fwnode_property_present(node, "label")) {
> > + ret = fwnode_property_read_string(node, "label", &label);
> > + if (ret) {
> > + dev_err(dev, "invalid label on %pfw\n", node);
> > + return ret;
return dev_err_probe(...);
> > + }
> > + data->channel_data[channel].label = label;
> > + } else {
> > + data->channel_data[channel].label = "";
>
> I think the normal way to do this is to return -EINVAL on channels with no
> label rather than an empty string.
In this case the whole dance with property_present is not required.
(What you are saying sounds like label is mandatory property, but
how the old DT will work that have no such property?)
> > + }
--
With Best Regards,
Andy Shevchenko