Re: [PATCH v3 2/2] iio: adc: ti-ads1015: Add support for label

From: Flaviu Nistor

Date: Tue Sep 08 2026 - 15:45:37 EST


On Tue, Sep 8, 2026 at 1:31 PM, Andy Shevchenko wrote:
>On Mon, Sep 07, 2026 at 06:23:04PM +0300, Flaviu Nistor wrote:
>> Add support for label sysfs attribute similar to other adc devices. This is
>> particularly useful because the label can match the schematic signal name,
>> identifying channel voltages easier if label is defined via device tree.
>...
>
>> +static int ads1015_read_label(struct iio_dev *indio_dev,
>> + struct iio_chan_spec const *chan, char *label)
>> +{
>> + struct ads1015_data *data = iio_priv(indio_dev);
>> + const char *name = data->channel_data[chan->address].label;
>> +
>> + /*
>> + * Avoid printing "(null)" in the console in case label property
>> + * is missing for the channel, or channel is not defined.
>> + */
>> + if (!name)
>> + name = chan->datasheet_name;
>
>Is the datasheet_name static? Can this rather be made only once
>at the probe time?
>

Good point. Yes it is static, so indeed I can move it to the probe function.
Will send out a v4.

Best Regards,
Flaviu

>> + return sysfs_emit(label, "%s\n", name);
>> +}
>
>--
>With Best Regards,
>Andy Shevchenko