Skip to content

Commit 19f3ceb

Browse files
Zicheng QuSasha Levin
authored andcommitted
iio: Fix fwnode_handle in __fwnode_iio_channel_get_by_name()
commit 3993ca4 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: [email protected] # v6.6+ Fixes: 1e64b9c ("iio: inkern: move to fwnode properties") Signed-off-by: Zicheng Qu <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 252eead commit 19f3ceb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/inkern.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ struct iio_channel *fwnode_iio_channel_get_by_name(struct fwnode_handle *fwnode,
276276
return ERR_PTR(-ENODEV);
277277
}
278278

279-
chan = __fwnode_iio_channel_get_by_name(fwnode, name);
279+
chan = __fwnode_iio_channel_get_by_name(parent, name);
280280
if (!IS_ERR(chan) || PTR_ERR(chan) != -ENODEV) {
281281
fwnode_handle_put(parent);
282282
return chan;

0 commit comments

Comments
 (0)