DORMANTno replies

[PATCH RFC] of: platform: Drop OF_POPULATED_BUS check from of_platform_notify()

From: Alexander Sverdlin <hidden>
Date: 2016-09-05 14:38:24
Subsystem: open firmware and flattened device tree, the rest · Maintainers: Rob Herring, Saravana Kannan, Linus Torvalds

The comment to OF_POPULATED_BUS says "of_platform_populate recursed to children
of this node". Consider the following structure:

	ocp {
		compatible = "simple-bus";
		ranges;
		...
		l4_wkup: l4_wkup@44c00000 {
			compatible = "ti,am3-l4-wkup", "simple-bus";
			ranges = <0 0x44c00000 0x280000>;
			...
			wkup_m3: wkup_m3@100000 {
				compatible = "ti,am3352-wkup-m3";
				...
			}
		}
	}

If one DT overlay adds "ocp" node without children then of_platform_notify()
creates a platform device, but doesn't set OF_POPULATED_BUS. If second overlay
tries to populate children of "ocp" node, corresponding platform devices are
not instantiated because of check for OF_POPULATED_BUS flag. If the above
example structure is built of several overlays, of_platform_populate() is not
involved here at all, so maybe OF_POPULATED_BUS requirement is wrong.

Signed-off-by: Alexander Sverdlin <redacted>
---
 drivers/of/platform.c | 4 ----
 1 file changed, 4 deletions(-)
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index f39ccd5..acebccd 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -578,10 +578,6 @@ static int of_platform_notify(struct notifier_block *nb,
 
 	switch (of_reconfig_get_state_change(action, rd)) {
 	case OF_RECONFIG_CHANGE_ADD:
-		/* verify that the parent is a bus */
-		if (!of_node_check_flag(rd->dn->parent, OF_POPULATED_BUS))
-			return NOTIFY_OK;	/* not for us */
-
 		/* already populated? (driver using of_populate manually) */
 		if (of_node_check_flag(rd->dn, OF_POPULATED))
 			return NOTIFY_OK;
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help