Skip to content

Commit 14659c1

Browse files
Zicheng QuWen Zhiwei
authored andcommitted
iio: Fix fwnode_handle in __fwnode_iio_channel_get_by_name()
stable inclusion from stable-v6.6.64 commit 98e1f03de842d0e8cd6c1171f40ce7ba998290bd category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBL4B6 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=98e1f03de842d0e8cd6c1171f40ce7ba998290bd -------------------------------- 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: [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]> Signed-off-by: Wen Zhiwei <[email protected]>
1 parent 1e15e6b commit 14659c1

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
@@ -277,7 +277,7 @@ struct iio_channel *fwnode_iio_channel_get_by_name(struct fwnode_handle *fwnode,
277277
return ERR_PTR(-ENODEV);
278278
}
279279

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

0 commit comments

Comments
 (0)