mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
iio: Fix fwnode_handle in __fwnode_iio_channel_get_by_name()
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: 1e64b9c5f9 ("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>
This commit is contained in:
parent
bfa335f18d
commit
3993ca4add
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user