[openwrt/openwrt] ramips: mtd_eth_soc: use dev_err_probe
LEDE Commits
lede-commits at lists.infradead.org
Tue Sep 17 07:18:50 PDT 2024
981213 pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a670cc286467bb4b79c94d88d6b21b0778b47c21
commit a670cc286467bb4b79c94d88d6b21b0778b47c21
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Wed Aug 14 19:25:21 2024 -0700
ramips: mtd_eth_soc: use dev_err_probe
Simplifies the code by avoiding having to manually handle -EPROBE_DEFER.
Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
.../linux/ramips/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);
More information about the lede-commits
mailing list