[PATCH] phy: core: fix registration of built in drivers

From: Baruch Siach
Date: Thu Mar 26 2015 - 23:52:14 EST


Built in PHY drivers probe may run as early as arch_initcall. This is the case
on ARM when device tree is enabled, since of_platform_populate() is called from
customize_machine(). The trouble is that at this stage phy_class is not yet
initialized, and as a result device_add() does not add the newly registered PHY
to the list of class device. This breaks of_phy_simple_xlate().

Move phy_class initialization before arch_initcall to fix this.

Signed-off-by: Baruch Siach <baruch@xxxxxxxxxx>
---
drivers/phy/phy-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index a12d35338313..648c3b179459 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -892,7 +892,7 @@ static int __init phy_core_init(void)

return 0;
}
-module_init(phy_core_init);
+postcore_initcall(phy_core_init);

static void __exit phy_core_exit(void)
{
--
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/