diff options
author | Zicheng Qu <quzicheng@huawei.com> | 2024-11-02 12:25:25 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-09 12:33:09 +0300 |
commit | 98e1f03de842d0e8cd6c1171f40ce7ba998290bd (patch) | |
tree | e75652f121655b18e7800b7306b0745a3d0b32a8 /drivers/iio | |
parent | 8e5e63d6ca95d234b70d5f3980f0efab1023af6e (diff) | |
download | linux-98e1f03de842d0e8cd6c1171f40ce7ba998290bd.tar.xz |
iio: Fix fwnode_handle in __fwnode_iio_channel_get_by_name()
commit 3993ca4add248f0f853f54f9273a7de850639f33 upstream.
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>
Link: https://patch.msgid.link/20241102092525.2389952-1-quzicheng@huawei.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/inkern.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 80e1c45485c9..079e30c522bb 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -277,7 +277,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; |