[openwrt/openwrt] ramips: ethernet: ralink: allow to return EPROBE_DEFER on switch_init
LEDE Commits
lede-commits at lists.infradead.org
Fri Jun 25 04:02:30 PDT 2021
lynxis pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/74c58c9d5844d52e23a7fc52f4d45a5fedd06a2b
commit 74c58c9d5844d52e23a7fc52f4d45a5fedd06a2b
Author: Alexander Couzens <lynxis at fe80.eu>
AuthorDate: Wed Jun 2 00:01:53 2021 +0000
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 at fe80.eu>
---
.../linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c | 9 +++++++--
1 file 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);
More information about the lede-commits
mailing list