Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Zicheng Qu <quzicheng@huawei.com>
Cc: <lars@metafoo.de>, <nuno.sa@analog.com>,
	<andy.shevchenko@gmail.com>, <linux-iio@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <tanghui20@huawei.com>,
	<zhangqiao22@huawei.com>, <judy.chenhui@huawei.com>
Subject: Re: [PATCH] iio: Fix fwnode_handle in __fwnode_iio_channel_get_by_name()
Date: Sat, 2 Nov 2024 15:18:20 +0000	[thread overview]
Message-ID: <20241102151820.609347ba@jic23-huawei> (raw)
In-Reply-To: <20241102092525.2389952-1-quzicheng@huawei.com>

On Sat, 2 Nov 2024 09:25:25 +0000
Zicheng Qu <quzicheng@huawei.com> wrote:

> In the fwnode_iio_channel_get_by_name(), iterating over parent nodes to
> acquire IIO channels via fwnode_for_each_parent_node(). The variable
> chan was mistakenly attempted on the original node instead of the
> current parent node. This patch corrects the logic to ensure that
> __fwnode_iio_channel_get_by_name() is called with the correct parent
> node.
> 
> Cc: stable@vger.kernel.org # v6.6+
> Fixes: 1e64b9c5f9a0 ("iio: inkern: move to fwnode properties")
> Signed-off-by: Zicheng Qu <quzicheng@huawei.com>
Hi Zicheng,

Good catch. I briefly wondered if this was unused code.  It is
used, just not that much and it seems not on boards anyone is
testing.

arch/arm/boot/dts/st/ste-ux500-samsung-janice.dts

Anyhow, fix looks good to me. Applied to the fixes-togreg branch of iio.git
and marked for stable.

Thanks,

Jonathan

> ---
>  drivers/iio/inkern.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> index 151099be2863..3305ebbdbc07 100644
> --- a/drivers/iio/inkern.c
> +++ b/drivers/iio/inkern.c
> @@ -269,7 +269,7 @@ struct iio_channel *fwnode_iio_channel_get_by_name(struct fwnode_handle *fwnode,
>  			return ERR_PTR(-ENODEV);
>  		}
>  
> -		chan = __fwnode_iio_channel_get_by_name(fwnode, name);
> +		chan = __fwnode_iio_channel_get_by_name(parent, name);
>  		if (!IS_ERR(chan) || PTR_ERR(chan) != -ENODEV) {
>  			fwnode_handle_put(parent);
>   			return chan;


      reply	other threads:[~2024-11-02 15:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-02  9:25 [PATCH] iio: Fix fwnode_handle in __fwnode_iio_channel_get_by_name() Zicheng Qu
2024-11-02 15:18 ` Jonathan Cameron [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=20241102151820.609347ba@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=judy.chenhui@huawei.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=quzicheng@huawei.com \
    --cc=tanghui20@huawei.com \
    --cc=zhangqiao22@huawei.com \
    /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