On Wed, Mar 25, 2026 at 09:02:41PM +0000, Antony Kurniawan Soemardi wrote:
> Implement the .read_label callback to allow userspace to identify ADC
> channels via the "label" property in the device tree. The name field in
> pm8xxx_chan_info is renamed to label to better reflect its purpose. If
> no label is provided in the device tree, it defaults to the hardware
> datasheet name.

> Tested-on: Sony Xperia SP (PM8921)

Interesting, never saw this tag before.

> Signed-off-by: Antony Kurniawan Soemardi <[email protected]>

...

> +static int pm8xxx_read_label(struct iio_dev *indio_dev,
> +                          struct iio_chan_spec const *chan, char *label)
> +{
> +     struct pm8xxx_xoadc *adc = iio_priv(indio_dev);
> +     struct pm8xxx_chan_info *ch = pm8xxx_get_channel(adc, chan->address);

> +     if (!ch) {
> +             dev_err(adc->dev, "no such channel %lu\n", chan->address);
> +             return -EINVAL;
> +     }

Isn't it a dead code? Also poisoning dmesg with this recurrent message is not
good idea to begin with (the user space will have a door to flood it, which
might be considered as an assistance to hackers to clear immediate logs after
a successful attack).

> +     return sysfs_emit(label, "%s\n", ch->label);
> +}

-- 
With Best Regards,
Andy Shevchenko



Reply via email to