From: Rosen Penev Date: Thu, 15 Aug 2024 02:25:21 +0000 (-0700) Subject: ramips: mtd_eth_soc: use dev_err_probe X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=a670cc286467bb4b79c94d88d6b21b0778b47c21;p=openwrt%2Fstaging%2Fblocktrron.git ramips: mtd_eth_soc: use dev_err_probe Simplifies the code by avoiding having to manually handle -EPROBE_DEFER. Signed-off-by: Rosen Penev --- 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);