From a670cc286467bb4b79c94d88d6b21b0778b47c21 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 14 Aug 2024 19:25:21 -0700 Subject: [PATCH] ramips: mtd_eth_soc: use dev_err_probe Simplifies the code by avoiding having to manually handle -EPROBE_DEFER. Signed-off-by: Rosen Penev --- .../files/drivers/net/ethernet/ralink/mtk_eth_soc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 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 e261d90924..c7e074aaa5 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 @@ -1354,13 +1354,8 @@ static int __init fe_init(struct net_device *dev) 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; - } + if (err) + return dev_err_probe(&dev->dev, err, "failed to initialize switch core"); } fe_reset_phy(priv); -- 2.30.2