Commit 6b5c3506 authored by Lee Jones's avatar Lee Jones
Browse files

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: default avatarBarry Song <Baohua.Song@csr.com>
Reported-by: default avatarStephan Gerhold <stephan@gerhold.net>
Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: default avatarMark Brown <broonie@kernel.org>
Tested-by: default avatarStephan Gerhold <stephan@gerhold.net>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 49461659
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -152,6 +152,11 @@ static int mfd_add_device(struct device *parent, int id,
	if (parent->of_node && cell->of_compatible) {
		for_each_child_of_node(parent->of_node, np) {
			if (of_device_is_compatible(np, cell->of_compatible)) {
				if (!of_device_is_available(np)) {
					/* Ignore disabled devices error free */
					ret = 0;
					goto fail_alias;
				}
				pdev->dev.of_node = np;
				pdev->dev.fwnode = &np->fwnode;
				break;