[openwrt/openwrt] ramips: ethernet: use devm for request_irq
LEDE Commits
lede-commits at lists.infradead.org
Mon Aug 19 01:45:15 PDT 2024
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/40452223d6a8c184db9836cea9f32e7f7f24ebe9
commit 40452223d6a8c184db9836cea9f32e7f7f24ebe9
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Mon Jul 29 18:31:53 2024 -0700
ramips: ethernet: use devm for request_irq
Allows removing free_irq. Simpler.
Oddly enough the other switch code already does this.
Signed-off-by: Rosen Penev <rosenp at gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16050
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c | 2 +-
target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
index dcaff04db1..5853df70c5 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
@@ -245,7 +245,7 @@ int mtk_gsw_init(struct fe_priv *priv)
mt7620_ephy_init(gsw);
if (gsw->irq) {
- ret = request_irq(gsw->irq, gsw_interrupt_mt7620, 0,
+ ret = devm_request_irq(&pdev->dev, gsw->irq, gsw_interrupt_mt7620, 0,
"gsw", priv);
if (ret) {
dev_err(&pdev->dev, "Failed to request irq");
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 e794f8d5cb..e261d90924 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
@@ -1414,7 +1414,6 @@ static void fe_uninit(struct net_device *dev)
fe_mdio_cleanup(priv);
fe_reg_w32(0, FE_REG_FE_INT_ENABLE);
- free_irq(dev->irq, dev);
}
static int fe_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
More information about the lede-commits
mailing list