aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2021-06-02 00:01:53 +0000
committerAlexander Couzens <lynxis@fe80.eu>2021-06-25 10:52:50 +0200
commit74c58c9d5844d52e23a7fc52f4d45a5fedd06a2b (patch)
treea370d721bc23910b8289b39beded282447908290 /target/linux
parent60fadae62b64b14faff818e4156d9c6eb3f96b65 (diff)
downloadupstream-74c58c9d5844d52e23a7fc52f4d45a5fedd06a2b.tar.gz
upstream-74c58c9d5844d52e23a7fc52f4d45a5fedd06a2b.tar.bz2
upstream-74c58c9d5844d52e23a7fc52f4d45a5fedd06a2b.zip
ramips: ethernet: ralink: allow to return EPROBE_DEFER on switch_init
For rt3050 the switch needs to be initialized before the ethernet start sending packets. Allow switch_init to return -EPROBE_DEFER. Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
index 8a088bd5ce..cf6d4806ed 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
@@ -1376,11 +1376,16 @@ static int __init fe_init(struct net_device *dev)
else
fe_reset_fe(priv);
- if (priv->soc->switch_init)
- if (priv->soc->switch_init(priv)) {
+ if (priv->soc->switch_init) {
+ err = priv->soc->switch_init(priv);
+ if (err) {
+ if (err == -EPROBE_DEFER)
+ return err;
+
netdev_err(dev, "failed to initialize switch core\n");
return -ENODEV;
}
+ }
fe_reset_phy(priv);