From: Flaviu Nistor <flaviu.nistor@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: David Lechner <dlechner@baylibre.com>,
Nuno Sa <nuno.sa@analog.com>, Andy Shevchenko <andy@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Rob Herring <robh@kernel.org>, Conor Dooley <conor+dt@kernel.org>,
Daniel Baluta <daniel.baluta@nxp.com>,
Antoniu Miclaus <antoniu.miclaus@analog.com>,
Flaviu Nistor <flaviu.nistor@gmail.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org
Subject: Re: [PATCH v2 2/2] iio: adc: ti-ads1015: Add support for label
Date: Mon, 7 Sep 2026 18:21:10 +0300 [thread overview]
Message-ID: <20260907152110.4934-1-flaviu.nistor@gmail.com> (raw)
In-Reply-To: <20260905030114.21de1faf@jic23-huawei>
On Sat, Sep 5, 2026 at 5:01 AM, Jonathan Cameron wrote:
>On Thu, 3 Sep 2026 22:03:55 +0300
>Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
>
>> On Thu, Sep 03, 2026 at 06:16:27PM +0300, Flaviu Nistor wrote:
>> > On Thu, Sep 3, 2026 at 9:18 AM, Andy Shevchenko wrote: =20
>>=20
>> ...
>>=20
>> > Since the iio core exposes in sysfs the in_volatagex_label
>> > for all channels, there are 3 situations: =20
>>=20
>> > 3. The channel is not defined in the dts (in_voltagex_label is still vi=
sible
>> > in the sysfs), and reading the label will cause "(null)\n" to be printe=
>d in
>> > the console (as indicated also by Sashiko boot), since the default "" v=
>alue
>> > is not assigned during device_for_each_child_node_scoped(). I think thi=
>s is
>> > not an issue since is just the way sysfs_emit() handles an NULL string.=
> =20
>>=20
>> Is this current state of affairs?
>>=20
>> If so, the patch must not change that =E2=80=94 it's an ABI now and (null=
>) is valid
>> response from the user space point of view.
>>=20
>> > What would you prefer? Any further suggestions? =20
>>=20
>Unfortunately we never defined what should happen this way explicitly.
>In practice assumption is that this is a corner case we probably won't
>see. People don't tend to want to label just one random pin, they tend
>to label the lot. =20
>
>So go with whatever is most common in other drivers,
>
Hello, I took some time and went through all of the drivers that use read_label()
to get the most common solution. Most of the drivers only use datasheet_name and only
a few actually get the label (if present) from the device tree during probe.
I now have the best solution (from my point of view), which covers all (3) cases. If
the label string is present in the device tree it will be use and printed in the console
in user space. If label not present or channel is not defined at all in the dts, the
datasheet_name will be used similar to most drivers. I will send a v3.
PS: many thanks for everybody for pushing for a better solution.
Best regards,
Flaviu
>Jonathan
next prev parent reply other threads:[~2026-09-07 15:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 17:22 [PATCH v2 1/2] dt-bindings: iio: adc: ti,ads1015: Add label property Flaviu Nistor
2026-09-02 17:22 ` [PATCH v2 2/2] iio: adc: ti-ads1015: Add support for label Flaviu Nistor
2026-09-02 18:37 ` David Lechner
2026-09-03 6:18 ` Andy Shevchenko
2026-09-03 15:16 ` Flaviu Nistor
2026-09-03 15:28 ` David Lechner
2026-09-03 19:03 ` Andy Shevchenko
2026-09-05 2:01 ` Jonathan Cameron
2026-09-07 15:21 ` Flaviu Nistor [this message]
2026-09-02 18:31 ` [PATCH v2 1/2] dt-bindings: iio: adc: ti,ads1015: Add label property David Lechner
2026-09-03 15:19 ` Flaviu Nistor
2026-09-03 15:30 ` David Lechner
2026-09-05 1:56 ` Jonathan Cameron
2026-09-07 7:59 ` Krzysztof Kozlowski
2026-09-05 1:54 ` Jonathan Cameron
2026-09-07 7:59 ` Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260907152110.4934-1-flaviu.nistor@gmail.com \
--to=flaviu.nistor@gmail.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=conor+dt@kernel.org \
--cc=daniel.baluta@nxp.com \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).