Skip to content

Commit 3993ca4

Browse files
Zicheng Qujic23
authored andcommitted
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: [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]>
1 parent bfa335f commit 3993ca4

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
@@ -269,7 +269,7 @@ struct iio_channel *fwnode_iio_channel_get_by_name(struct fwnode_handle *fwnode,
269269
return ERR_PTR(-ENODEV);
270270
}
271271

272-
chan = __fwnode_iio_channel_get_by_name(fwnode, name);
272+
chan = __fwnode_iio_channel_get_by_name(parent, name);
273273
if (!IS_ERR(chan) || PTR_ERR(chan) != -ENODEV) {
274274
fwnode_handle_put(parent);
275275
return chan;

0 commit comments

Comments
 (0)