From: Zicheng Qu <quzicheng@huawei.com>
To: <jic23@kernel.org>, <lars@metafoo.de>, <nuno.sa@analog.com>,
<andy.shevchenko@gmail.com>, <linux-iio@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: <tanghui20@huawei.com>, <zhangqiao22@huawei.com>,
<judy.chenhui@huawei.com>, <quzicheng@huawei.com>
Subject: [PATCH] iio: Fix fwnode_handle in __fwnode_iio_channel_get_by_name()
Date: Sat, 2 Nov 2024 09:25:25 +0000 [thread overview]
Message-ID: <20241102092525.2389952-1-quzicheng@huawei.com> (raw)
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>
---
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;
--
2.34.1
next reply other threads:[~2024-11-02 9:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-02 9:25 Zicheng Qu [this message]
2024-11-02 15:18 ` [PATCH] iio: Fix fwnode_handle in __fwnode_iio_channel_get_by_name() Jonathan Cameron
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=20241102092525.2389952-1-quzicheng@huawei.com \
--to=quzicheng@huawei.com \
--cc=andy.shevchenko@gmail.com \
--cc=jic23@kernel.org \
--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=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