ramips: convert driver to .remove_new
authorMieczyslaw Nalewaj <[email protected]>
Sun, 13 Apr 2025 21:58:40 +0000 (23:58 +0200)
committerHauke Mehrtens <[email protected]>
Tue, 22 Apr 2025 17:21:07 +0000 (19:21 +0200)
Convert driver to .remove_new in preparation for kernel 6.12 support.

Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/18535
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/ramips/files/drivers/dma/mediatek/hsdma-mt7621.c
target/linux/ramips/files/drivers/dma/ralink-gdma.c
target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c
target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c

index a3a9a7f4ae9d09b93218affd9ebdb3b98b555a4a..b99b4a920f3fdff9b013ae5de7023b34003f3462 100644 (file)
@@ -733,7 +733,7 @@ err_uninit_hsdma:
        return ret;
 }
 
-static int mtk_hsdma_remove(struct platform_device *pdev)
+static void mtk_hsdma_remove(struct platform_device *pdev)
 {
        struct mtk_hsdam_engine *hsdma = platform_get_drvdata(pdev);
 
@@ -741,13 +741,11 @@ static int mtk_hsdma_remove(struct platform_device *pdev)
 
        of_dma_controller_free(pdev->dev.of_node);
        dma_async_device_unregister(&hsdma->ddev);
-
-       return 0;
 }
 
 static struct platform_driver mtk_hsdma_driver = {
        .probe = mtk_hsdma_probe,
-       .remove = mtk_hsdma_remove,
+       .remove_new = mtk_hsdma_remove,
        .driver = {
                .name = KBUILD_MODNAME,
                .of_match_table = mtk_hsdma_of_match,
index e510a05ebbe319c820739b5bd0911a9202afc656..41220d83dd30ca9a74564ae8ce03a86ba21b3f28 100644 (file)
@@ -890,20 +890,18 @@ err_unregister:
        return ret;
 }
 
-static int gdma_dma_remove(struct platform_device *pdev)
+static void gdma_dma_remove(struct platform_device *pdev)
 {
        struct gdma_dma_dev *dma_dev = platform_get_drvdata(pdev);
 
        tasklet_kill(&dma_dev->task);
        of_dma_controller_free(pdev->dev.of_node);
        dma_async_device_unregister(&dma_dev->ddev);
-
-       return 0;
 }
 
 static struct platform_driver gdma_dma_driver = {
        .probe = gdma_dma_probe,
-       .remove = gdma_dma_remove,
+       .remove_new = gdma_dma_remove,
        .driver = {
                .name = "gdma-rt2880",
                .of_match_table = gdma_of_match_table,
index a9c242bfd36840e84e8eedbc1a8bbc02ce657afc..fc89fa5f8b0ce8acbd84432ebc6d8f55d7082fe8 100644 (file)
@@ -2346,7 +2346,7 @@ host_free:
 }
 
 /* 4 device share one driver, using "drvdata" to show difference */
-static int msdc_drv_remove(struct platform_device *pdev)
+static void msdc_drv_remove(struct platform_device *pdev)
 {
        struct mmc_host *mmc;
        struct msdc_host *host;
@@ -2371,8 +2371,6 @@ static int msdc_drv_remove(struct platform_device *pdev)
                          host->dma.bd,  host->dma.bd_addr);
 
        mmc_free_host(host->mmc);
-
-       return 0;
 }
 
 /* Fix me: Power Flow */
@@ -2412,7 +2410,7 @@ MODULE_DEVICE_TABLE(of, mt7620_sdhci_match);
 
 static struct platform_driver mt_msdc_driver = {
        .probe   = msdc_drv_probe,
-       .remove  = msdc_drv_remove,
+       .remove_new  = msdc_drv_remove,
 #ifdef CONFIG_PM
        .suspend = msdc_drv_suspend,
        .resume  = msdc_drv_resume,
index 0ac191ea66854ec67aeef691f05c314ec39c6564..bd071c9ec3278756d7fd5cd724862ee85de7d899 100644 (file)
@@ -1312,7 +1312,7 @@ static int mt7621_nfc_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int mt7621_nfc_remove(struct platform_device *pdev)
+static void mt7621_nfc_remove(struct platform_device *pdev)
 {
        struct mt7621_nfc *nfc = platform_get_drvdata(pdev);
        struct nand_chip *nand = &nfc->nand;
@@ -1321,8 +1321,6 @@ static int mt7621_nfc_remove(struct platform_device *pdev)
        mtk_bmt_detach(mtd);
        mtd_device_unregister(mtd);
        nand_cleanup(nand);
-
-       return 0;
 }
 
 static const struct of_device_id mt7621_nfc_id_table[] = {
@@ -1333,7 +1331,7 @@ MODULE_DEVICE_TABLE(of, match);
 
 static struct platform_driver mt7621_nfc_driver = {
        .probe = mt7621_nfc_probe,
-       .remove = mt7621_nfc_remove,
+       .remove_new = mt7621_nfc_remove,
        .driver = {
                .name = MT7621_NFC_NAME,
                .of_match_table = mt7621_nfc_id_table,
index bbb52d74b240a2f25e57ec96f5bab4f33085b987..9181ebba5c0163163938d65902680cd8ffc39ac2 100644 (file)
@@ -1437,7 +1437,7 @@ static int esw_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int esw_remove(struct platform_device *pdev)
+static void esw_remove(struct platform_device *pdev)
 {
        struct rt305x_esw *esw = platform_get_drvdata(pdev);
 
@@ -1445,8 +1445,6 @@ static int esw_remove(struct platform_device *pdev)
                esw_w32(esw, ~0, RT305X_ESW_REG_IMR);
                platform_set_drvdata(pdev, NULL);
        }
-
-       return 0;
 }
 
 static const struct of_device_id ralink_esw_match[] = {
@@ -1522,7 +1520,7 @@ int rt3050_esw_init(struct fe_priv *priv)
 
 static struct platform_driver esw_driver = {
        .probe = esw_probe,
-       .remove = esw_remove,
+       .remove_new = esw_remove,
        .driver = {
                .name = "rt3050-esw",
                .of_match_table = ralink_esw_match,
index 154983494ee1aa47e6705062189910b3729b7d2e..593caaa6a7f2169ecf4168943a3fb65773bbd914 100644 (file)
@@ -284,16 +284,14 @@ static int mt7620_gsw_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int mt7620_gsw_remove(struct platform_device *pdev)
+static void mt7620_gsw_remove(struct platform_device *pdev)
 {
        platform_set_drvdata(pdev, NULL);
-
-       return 0;
 }
 
 static struct platform_driver gsw_driver = {
        .probe = mt7620_gsw_probe,
-       .remove = mt7620_gsw_remove,
+       .remove_new = mt7620_gsw_remove,
        .driver = {
                .name = "mt7620-gsw",
                .of_match_table = mediatek_gsw_match,
index 4dff1340d7057172297a6bd77d6a24a1f51b2eeb..5a8e92ab12169df953909c996f30601e03c9e0ca 100644 (file)
@@ -1638,7 +1638,7 @@ static int fe_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int fe_remove(struct platform_device *pdev)
+static void fe_remove(struct platform_device *pdev)
 {
        struct net_device *dev = platform_get_drvdata(pdev);
        struct fe_priv *priv = netdev_priv(dev);
@@ -1648,13 +1648,11 @@ static int fe_remove(struct platform_device *pdev)
        cancel_work_sync(&priv->pending_work);
 
        platform_set_drvdata(pdev, NULL);
-
-       return 0;
 }
 
 static struct platform_driver fe_driver = {
        .probe = fe_probe,
-       .remove = fe_remove,
+       .remove_new = fe_remove,
        .driver = {
                .name = "mtk_soc_eth",
                .of_match_table = of_fe_match,