Re: [PATCH] of/platform: dynamic: Use of_platform_bus_create() to create devices
From: Alexander Sverdlin <hidden>
Date: 2017-01-23 15:07:07
Hi Rob, On 21/01/17 20:51, Rob Herring wrote:
On Fri, Jan 20, 2017 at 11:38 AM, Alexander Sverdlin [off-list ref] wrote:quoted
Hello Rob, On 27/10/16 15:00, Rob Herring wrote:quoted
quoted
@@ -534,15 +535,15 @@ static int of_platform_notify(struct notifier_block *nb, /* pdev_parent may be NULL when no bus platform device */ pdev_parent = of_find_device_by_node(rd->dn->parent); - pdev = of_platform_device_create(rd->dn, NULL, - pdev_parent ? &pdev_parent->dev : NULL); + ret = of_platform_bus_create(rd->dn, of_default_bus_match_table, + NULL, pdev_parent ? + &pdev_parent->dev : NULL, true);I think this should be of_platform_default_populate() instead.I've just tested: it cannot be. It calls of_platform_populate(), which ignores "status" property. This not only brakes half of the unit tests, but also would change the existing behavior of overlays (they will completely ignore "status" too).That's a bug. I assume that's only at the 1st level or things would be completely broken.
well, after two unsuccessful attempts to use of_platform_default_populate() in of_platform_notify() I see what the actual problem is: of_platform_*populate() do not populate the root node itself, therefore they are not suitable for of_platform_notify(). -- Best regards, Alexander Sverdlin. -- 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