Message ID | 20230116220909.196926-2-marijn.suijten@somainline.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1424948wrn; Mon, 16 Jan 2023 14:11:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXs0VDonnUwWgmcYot1EcclyJnVa6kuC2na5jvt26lqpDz3L2Zd90YeL+6l1Go+yUSVlIvAN X-Received: by 2002:a05:6a20:c120:b0:b8:8027:13a5 with SMTP id bh32-20020a056a20c12000b000b8802713a5mr416638pzb.33.1673907062816; Mon, 16 Jan 2023 14:11:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673907062; cv=none; d=google.com; s=arc-20160816; b=mZZsaTPhc/y6HwIWdOEVnuoIeyfg0emvAZoj8IGpiMVEfij/8P/iN39j5ZK9nLWl7Q pyPsmwnWWjbEftMlod5MD1Rg3TP2bS4UXqLQfKrWi3EnBvRVOmDe1HU+AbdSSOBHZSOW fjLnZSoBra3+uQdXhxBLwOUTtkmFJozkJoug0rVfCja6cMR6Of4n1en9b0WSVEDQuhMn bbms0mevn75CoI4oCmMX7ih2Fk75a1kZNWwK1vZCjagJjUg36OgSVvHS3Egq2vQM4UFJ 6R4FfBY/UddiT1dypKBpQIXm9ONUuW0gMl/ZgE0mDCsDzXYHUSCPIewNZdJ03ZbfyBGq mSZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=xKKXcNTJ2rjZU9rWtZ3CfrhQ5F5zUMybIfhzpTVJQqE=; b=A52eC7MhE+dPvRf7BbexlKAf0xur0VoU3nWtgNaT6vUhSBOEg1GKBTuplCoHKpQAbF ldImBBzyH0NdXXI6ZE+fhJWzCe+GMxmeIp7MHeKorK2hyyUJukAspVuxvZ+PmL9SW48U +1h1grzySAKPwO/jh24pYgiTvGaSAXED+YVe6qGa0a/xrAQEMrQZyrQ2j7vY2Hmp2fZd /ZczE5VJPhwOuGSBh9Vyu7us9TPa2PwiC/TIT/JoZZiLtPEZD3iTHPtyHnqjk3o0oT+1 nj767zTWFQDccr84zJrnxk/3Xvnwt7T7Gew0B1dtdq/6159NM7xB/3JCTxwuLinA/MK6 qr9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a654145000000b004cb94362cb8si7206066pgp.195.2023.01.16.14.10.49; Mon, 16 Jan 2023 14:11:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235091AbjAPWK1 (ORCPT <rfc822;stefanalexe802@gmail.com> + 99 others); Mon, 16 Jan 2023 17:10:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235035AbjAPWKH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 16 Jan 2023 17:10:07 -0500 Received: from relay07.th.seeweb.it (relay07.th.seeweb.it [IPv6:2001:4b7a:2000:18::168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DF722A172 for <linux-kernel@vger.kernel.org>; Mon, 16 Jan 2023 14:10:01 -0800 (PST) Received: from localhost.localdomain (94-211-6-86.cable.dynamic.v4.ziggo.nl [94.211.6.86]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id BF8153F254; Mon, 16 Jan 2023 23:09:58 +0100 (CET) From: Marijn Suijten <marijn.suijten@somainline.org> To: phone-devel@vger.kernel.org, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Jonathan Cameron <jic23@kernel.org> Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Martin Botka <martin.botka@somainline.org>, Jami Kettunen <jami.kettunen@somainline.org>, Marijn Suijten <marijn.suijten@somainline.org>, Lars-Peter Clausen <lars@metafoo.de>, linux-arm-msm@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v2 1/5] iio: core: Point users of extend_name field to read_label callback Date: Mon, 16 Jan 2023 23:09:05 +0100 Message-Id: <20230116220909.196926-2-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116220909.196926-1-marijn.suijten@somainline.org> References: <20230116220909.196926-1-marijn.suijten@somainline.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755218772273856918?= X-GMAIL-MSGID: =?utf-8?q?1755218772273856918?= |
Series |
iio: adc: qcom-spmi-vadc: Propagate fw node label to userspace
|
|
Commit Message
Marijn Suijten
Jan. 16, 2023, 10:09 p.m. UTC
As mentioned and discussed in [1] extend_name should not be used for
full channel labels (and most drivers seem to only use it to express a
short type of a channel) as this affects sysfs filenames, while the
label name is supposed to be extracted from the *_label sysfs file
instead. This appears to have been unclear to some drivers as
extend_name is also used when read_label is unset, achieving an initial
goal of providing sensible names in *_label sysfs files without noticing
that sysfs filenames are (negatively and likely unintentionally)
affected as well.
Point readers of iio_chan_spec::extend_name to iio_info::read_label by
mentioning deprecation and side-effects of this field.
[1]: https://lore.kernel.org/linux-arm-msm/20221221223432.si2aasbleiicayfl@SoMainline.org/
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
include/linux/iio/iio.h | 3 +++
1 file changed, 3 insertions(+)
Comments
On Mon, 16 Jan 2023 23:09:05 +0100 Marijn Suijten <marijn.suijten@somainline.org> wrote: > As mentioned and discussed in [1] extend_name should not be used for > full channel labels (and most drivers seem to only use it to express a > short type of a channel) as this affects sysfs filenames, while the > label name is supposed to be extracted from the *_label sysfs file > instead. This appears to have been unclear to some drivers as > extend_name is also used when read_label is unset, achieving an initial > goal of providing sensible names in *_label sysfs files without noticing > that sysfs filenames are (negatively and likely unintentionally) > affected as well. > > Point readers of iio_chan_spec::extend_name to iio_info::read_label by > mentioning deprecation and side-effects of this field. > > [1]: https://lore.kernel.org/linux-arm-msm/20221221223432.si2aasbleiicayfl@SoMainline.org/ > > Suggested-by: Jonathan Cameron <jic23@kernel.org> > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> > --- > include/linux/iio/iio.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h > index 81413cd3a3e7..36c89f238fb9 100644 > --- a/include/linux/iio/iio.h > +++ b/include/linux/iio/iio.h > @@ -221,6 +221,9 @@ struct iio_event_spec { > * @extend_name: Allows labeling of channel attributes with an > * informative name. Note this has no effect codes etc, > * unlike modifiers. > + * This field is deprecated in favour of overriding read_label > + * in iio_info, which unlike @extend_name does not affect sysfs > + * filenames. Perhaps reword as This field is deprecated in favour of overriding the default label by providing a read_label() callback in iio_info, which unlike @extend_name does not affect sysfs filenames. ? > * @datasheet_name: A name used in in-kernel mapping of channels. It should > * correspond to the first name that the channel is referred > * to by in the datasheet (e.g. IND), or the nearest
On 2023-01-18 16:19:20, Jonathan Cameron wrote: > On Mon, 16 Jan 2023 23:09:05 +0100 > Marijn Suijten <marijn.suijten@somainline.org> wrote: > > > As mentioned and discussed in [1] extend_name should not be used for > > full channel labels (and most drivers seem to only use it to express a > > short type of a channel) as this affects sysfs filenames, while the > > label name is supposed to be extracted from the *_label sysfs file > > instead. This appears to have been unclear to some drivers as > > extend_name is also used when read_label is unset, achieving an initial > > goal of providing sensible names in *_label sysfs files without noticing > > that sysfs filenames are (negatively and likely unintentionally) > > affected as well. > > > > Point readers of iio_chan_spec::extend_name to iio_info::read_label by > > mentioning deprecation and side-effects of this field. > > > > [1]: https://lore.kernel.org/linux-arm-msm/20221221223432.si2aasbleiicayfl@SoMainline.org/ > > > > Suggested-by: Jonathan Cameron <jic23@kernel.org> > > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> > > --- > > include/linux/iio/iio.h | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h > > index 81413cd3a3e7..36c89f238fb9 100644 > > --- a/include/linux/iio/iio.h > > +++ b/include/linux/iio/iio.h > > @@ -221,6 +221,9 @@ struct iio_event_spec { > > * @extend_name: Allows labeling of channel attributes with an > > * informative name. Note this has no effect codes etc, > > * unlike modifiers. > > + * This field is deprecated in favour of overriding read_label > > + * in iio_info, which unlike @extend_name does not affect sysfs > > + * filenames. > Perhaps reword as > > This field is deprecated in favour of overriding the default label > by providing a read_label() callback in iio_info, which unlike > @extend_name does not affect sysfs filenames. > ? Agreed, explicitly stating "the default label by" makes this much more clear. Though, maybe swap that around into "in favour of providing read_label() in iio_info to override the label"? Otherwise this could be interpreted as "overriding the default label" is preferred to setting extend_name... which one would do to override the default label. I can queue this up for v3 unless you'll fix it up while applying, presuming no other changes have to be made (aside from dropping patch 3/5). Will read_label() turn into a link? And is the @extend_name reference proper? Is there something to link to iio_info, perhaps a hashtag - or maybe fully qualify `#iio_info::read_label()` for linking purposes? /me jumps over to kerneldoc documentation :) - Marijn > > * @datasheet_name: A name used in in-kernel mapping of channels. It should > > * correspond to the first name that the channel is referred > > * to by in the datasheet (e.g. IND), or the nearest >
On 2023-01-18 17:35:27, Marijn Suijten wrote: > On 2023-01-18 16:19:20, Jonathan Cameron wrote: > > On Mon, 16 Jan 2023 23:09:05 +0100 > > Marijn Suijten <marijn.suijten@somainline.org> wrote: > > > > > As mentioned and discussed in [1] extend_name should not be used for > > > full channel labels (and most drivers seem to only use it to express a > > > short type of a channel) as this affects sysfs filenames, while the > > > label name is supposed to be extracted from the *_label sysfs file > > > instead. This appears to have been unclear to some drivers as > > > extend_name is also used when read_label is unset, achieving an initial > > > goal of providing sensible names in *_label sysfs files without noticing > > > that sysfs filenames are (negatively and likely unintentionally) > > > affected as well. > > > > > > Point readers of iio_chan_spec::extend_name to iio_info::read_label by > > > mentioning deprecation and side-effects of this field. > > > > > > [1]: https://lore.kernel.org/linux-arm-msm/20221221223432.si2aasbleiicayfl@SoMainline.org/ > > > > > > Suggested-by: Jonathan Cameron <jic23@kernel.org> > > > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> > > > --- > > > include/linux/iio/iio.h | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h > > > index 81413cd3a3e7..36c89f238fb9 100644 > > > --- a/include/linux/iio/iio.h > > > +++ b/include/linux/iio/iio.h > > > @@ -221,6 +221,9 @@ struct iio_event_spec { > > > * @extend_name: Allows labeling of channel attributes with an > > > * informative name. Note this has no effect codes etc, > > > * unlike modifiers. > > > + * This field is deprecated in favour of overriding read_label > > > + * in iio_info, which unlike @extend_name does not affect sysfs > > > + * filenames. > > Perhaps reword as > > > > This field is deprecated in favour of overriding the default label > > by providing a read_label() callback in iio_info, which unlike > > @extend_name does not affect sysfs filenames. > > ? > > Agreed, explicitly stating "the default label by" makes this much more > clear. Though, maybe swap that around into "in favour of providing > read_label() in iio_info to override the label"? Otherwise this could > be interpreted as "overriding the default label" is preferred to setting > extend_name... which one would do to override the default label. > > I can queue this up for v3 unless you'll fix it up while applying, > presuming no other changes have to be made (aside from dropping patch > 3/5). > > Will read_label() turn into a link? And is the @extend_name reference Yes, if read_label is a function that exists (but it's a member)... and @extend_name will indeed reference the member anywhere. > proper? Is there something to link to iio_info, perhaps a hashtag - or > maybe fully qualify `#iio_info::read_label()` for linking purposes? > /me jumps over to kerneldoc documentation :) Looks like that would be &iio_info->read_label() (not sure about the trailing () though): https://docs.kernel.org/doc-guide/kernel-doc.html#highlights-and-cross-references - Marijn
On Wed, 18 Jan 2023 17:35:25 +0100 Marijn Suijten <marijn.suijten@somainline.org> wrote: > On 2023-01-18 16:19:20, Jonathan Cameron wrote: > > On Mon, 16 Jan 2023 23:09:05 +0100 > > Marijn Suijten <marijn.suijten@somainline.org> wrote: > > > > > As mentioned and discussed in [1] extend_name should not be used for > > > full channel labels (and most drivers seem to only use it to express a > > > short type of a channel) as this affects sysfs filenames, while the > > > label name is supposed to be extracted from the *_label sysfs file > > > instead. This appears to have been unclear to some drivers as > > > extend_name is also used when read_label is unset, achieving an initial > > > goal of providing sensible names in *_label sysfs files without noticing > > > that sysfs filenames are (negatively and likely unintentionally) > > > affected as well. > > > > > > Point readers of iio_chan_spec::extend_name to iio_info::read_label by > > > mentioning deprecation and side-effects of this field. > > > > > > [1]: https://lore.kernel.org/linux-arm-msm/20221221223432.si2aasbleiicayfl@SoMainline.org/ > > > > > > Suggested-by: Jonathan Cameron <jic23@kernel.org> > > > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> > > > --- > > > include/linux/iio/iio.h | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h > > > index 81413cd3a3e7..36c89f238fb9 100644 > > > --- a/include/linux/iio/iio.h > > > +++ b/include/linux/iio/iio.h > > > @@ -221,6 +221,9 @@ struct iio_event_spec { > > > * @extend_name: Allows labeling of channel attributes with an > > > * informative name. Note this has no effect codes etc, > > > * unlike modifiers. > > > + * This field is deprecated in favour of overriding read_label > > > + * in iio_info, which unlike @extend_name does not affect sysfs > > > + * filenames. > > Perhaps reword as > > > > This field is deprecated in favour of overriding the default label > > by providing a read_label() callback in iio_info, which unlike > > @extend_name does not affect sysfs filenames. > > ? > > Agreed, explicitly stating "the default label by" makes this much more > clear. Though, maybe swap that around into "in favour of providing > read_label() in iio_info to override the label"? Otherwise this could > be interpreted as "overriding the default label" is preferred to setting > extend_name... which one would do to override the default label. Sure that works. > > I can queue this up for v3 unless you'll fix it up while applying, > presuming no other changes have to be made (aside from dropping patch > 3/5). I haven't looked closely enough at the rest, but if this is all that needs updating I'll change it whilst applying. > > Will read_label() turn into a link? And is the @extend_name reference > proper? Is there something to link to iio_info, perhaps a hashtag - or > maybe fully qualify `#iio_info::read_label()` for linking purposes? > /me jumps over to kerneldoc documentation :) > > - Marijn > > > > * @datasheet_name: A name used in in-kernel mapping of channels. It should > > > * correspond to the first name that the channel is referred > > > * to by in the datasheet (e.g. IND), or the nearest > > >
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 81413cd3a3e7..36c89f238fb9 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -221,6 +221,9 @@ struct iio_event_spec { * @extend_name: Allows labeling of channel attributes with an * informative name. Note this has no effect codes etc, * unlike modifiers. + * This field is deprecated in favour of overriding read_label + * in iio_info, which unlike @extend_name does not affect sysfs + * filenames. * @datasheet_name: A name used in in-kernel mapping of channels. It should * correspond to the first name that the channel is referred * to by in the datasheet (e.g. IND), or the nearest