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>
This commit is contained in:
Alexander Couzens 2021-06-02 00:01:53 +00:00
parent 60fadae62b
commit 74c58c9d58

View File

@ -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);