aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/net/phy/rtl8367.c
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@gmail.com>2018-10-17 22:37:36 +0200
committerJohn Crispin <john@phrozen.org>2018-11-26 12:05:46 +0100
commit910c2f9e68554ed36f622d005c76f39780b367ab (patch)
tree33b29da65a5702ce8d4faf4714a076764456f677 /target/linux/generic/files/drivers/net/phy/rtl8367.c
parentfb4bed5fe93961d769317014133a4d0006e5a6ea (diff)
downloadupstream-910c2f9e68554ed36f622d005c76f39780b367ab.tar.gz
upstream-910c2f9e68554ed36f622d005c76f39780b367ab.tar.bz2
upstream-910c2f9e68554ed36f622d005c76f39780b367ab.zip
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 <chunkeey@gmail.com>
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/rtl8367.c')
-rw-r--r--target/linux/generic/files/drivers/net/phy/rtl8367.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8367.c b/target/linux/generic/files/drivers/net/phy/rtl8367.c
index 9549961d76..7f0569d038 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8367.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8367.c
@@ -1752,8 +1752,8 @@ static int rtl8367_probe(struct platform_device *pdev)
int err;
smi = rtl8366_smi_probe(pdev);
- if (!smi)
- return -ENODEV;
+ if (IS_ERR(smi))
+ return PTR_ERR(smi);
smi->clk_delay = 1500;
smi->cmd_read = 0xb9;