]> git.hungrycats.org Git - linux/commit
iio: Fix fwnode_handle in __fwnode_iio_channel_get_by_name()
authorZicheng Qu <quzicheng@huawei.com>
Sat, 2 Nov 2024 09:25:25 +0000 (09:25 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Dec 2024 09:41:09 +0000 (10:41 +0100)
commitee7a0a9daa8e918ef60cbd5c563794ad8b675ba8
treef4c5b34cf44a9219bd5d055ce7d3a3f92523f040
parentc11a06753211c186fa67b1fefb64a027e6a2e8dc
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>
drivers/iio/inkern.c