ramips: ethernet: use devm for request_irq
authorRosen Penev <rosenp@gmail.com>
Tue, 30 Jul 2024 01:31:53 +0000 (18:31 -0700)
committerRobert Marko <robimarko@gmail.com>
Mon, 19 Aug 2024 08:45:06 +0000 (10:45 +0200)
Allows removing free_irq. Simpler.

Oddly enough the other switch code already does this.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16050
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c

index dcaff04db1ea86f1404c6d836e608fa71c713108..5853df70c581a08d8af9fecd075ef01aa7667b07 100644 (file)
@@ -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");
index e794f8d5cbc44f09a86bade04a992bb8fc4d9998..e261d90924db42f33684e4782bb468bde998a1d9 100644 (file)
@@ -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)