From 910c2f9e68554ed36f622d005c76f39780b367ab Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Wed, 17 Oct 2018 22:37:36 +0200 Subject: generic: rtl836x: support defered probe on mdio-bus On the WNDAP620, the mdio and mdc lines are controlled by the EMAC ethernet device. This results in a hen-vs-egg problem. The rtl8367b driver is probed before the ethernet driver and the mdio-bus is not available yet, which caused the rtl8367b driver to fail. This patch changes the rtl8366_smi_probe_of() function to return -EPROBE_DEFER if the mdio-bus lookup failed and changes rtl8366_smi_probe()'s signature to return the error code back to the callee, so it can propagate back to the kernel. Which, will retry the switch probe at a later time. Signed-off-by: Christian Lamparter --- target/linux/generic/files/drivers/net/phy/rtl8366rb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'target/linux/generic/files/drivers/net/phy/rtl8366rb.c') diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c index dc394c02b6..0e0116051a 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c @@ -1445,8 +1445,8 @@ static int rtl8366rb_probe(struct platform_device *pdev) " version " RTL8366RB_DRIVER_VER"\n"); smi = rtl8366_smi_probe(pdev); - if (!smi) - return -ENODEV; + if (IS_ERR(smi)) + return PTR_ERR(smi); smi->clk_delay = 10; smi->cmd_read = 0xa9; -- cgit v1.2.3