Skip to content

Commit 6b5c350

Browse files
author
Lee Jones
committed
mfd: mfd-core: Honour Device Tree's request to disable a child-device
Until now, MFD has assumed all child devices passed to it (via mfd_cells) are to be registered. It does not take into account requests from Device Tree and the like to disable child devices on a per-platform basis. Well now it does. Link: https://www.spinics.net/lists/arm-kernel/msg366309.html Link: https://lkml.org/lkml/2019/8/22/1350 Reported-by: Barry Song <[email protected]> Reported-by: Stephan Gerhold <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Reviewed-by: Mark Brown <[email protected]> Tested-by: Stephan Gerhold <[email protected]> Signed-off-by: Lee Jones <[email protected]>
1 parent 4946165 commit 6b5c350

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/mfd/mfd-core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ static int mfd_add_device(struct device *parent, int id,
152152
if (parent->of_node && cell->of_compatible) {
153153
for_each_child_of_node(parent->of_node, np) {
154154
if (of_device_is_compatible(np, cell->of_compatible)) {
155+
if (!of_device_is_available(np)) {
156+
/* Ignore disabled devices error free */
157+
ret = 0;
158+
goto fail_alias;
159+
}
155160
pdev->dev.of_node = np;
156161
pdev->dev.fwnode = &np->fwnode;
157162
break;

0 commit comments

Comments
 (0)