public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Antony Kurniawan Soemardi <linux@smankusors.com>
Cc: "Bjorn Andersson" <andersson@kernel.org>,
	"Konrad Dybcio" <konradybcio@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	phone-devel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels
Date: Sat, 4 Apr 2026 22:28:01 +0300	[thread overview]
Message-ID: <adFmQeMVKB125lgJ@ashevche-desk.local> (raw)
In-Reply-To: <20260403-pm8xxx-xoadc-label-v2-3-29b50bf821e6@smankusors.com>

On Fri, Apr 03, 2026 at 09:23:21AM +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.
> 
> The change has been tested on Sony Xperia SP (PM8921).

...

> +	ret = fwnode_property_read_string(fwnode, "label", &ch->label);
> +	if (ret)
> +		ch->label = hwchan->datasheet_name;

Branch is not needed.

	ch->label = hwchan->datasheet_name;
	fwnode_property_read_string(fwnode, "label", &ch->label);

will have the same effect. But if you want to handle errors, you may do

	if (fwnode_property_present(...)) {
		ret = fwnode_property_read_string(...);
		if (ret)
			return ret;
	} else {
		...assign default...
	}


-- 
With Best Regards,
Andy Shevchenko



      parent reply	other threads:[~2026-04-04 19:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03  9:23 [PATCH v2 0/3] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT Antony Kurniawan Soemardi
2026-04-03  9:23 ` [PATCH v2 1/3] ARM: dts: qcom: pm8921: add labels for ADC channels Antony Kurniawan Soemardi
2026-04-03 21:47   ` Dmitry Baryshkov
2026-04-03  9:23 ` [PATCH v2 2/3] iio: adc: qcom-pm8xxx-xoadc: remove redundant error logging in pm8xxx_read_raw Antony Kurniawan Soemardi
2026-04-03 21:54   ` Dmitry Baryshkov
2026-04-04  3:26     ` Antony Kurniawan Soemardi
2026-04-04 19:29       ` Andy Shevchenko
2026-04-04 19:28     ` Andy Shevchenko
2026-04-03  9:23 ` [PATCH v2 3/3] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels Antony Kurniawan Soemardi
2026-04-03 21:57   ` Dmitry Baryshkov
2026-04-04 19:28   ` Andy Shevchenko [this message]

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=adFmQeMVKB125lgJ@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andersson@kernel.org \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@smankusors.com \
    --cc=nuno.sa@analog.com \
    --cc=phone-devel@vger.kernel.org \
    --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