[openwrt/openwrt] ramips: convert driver to .remove_new

LEDE Commits lede-commits at lists.infradead.org
Tue Apr 22 10:22:28 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8de91748167c4a94b33569111861d64e0384de94

commit 8de91748167c4a94b33569111861d64e0384de94
Author: Mieczyslaw Nalewaj <namiltd at yahoo.com>
AuthorDate: Sun Apr 13 23:58:40 2025 +0200

    ramips: convert driver to .remove_new
    
    Convert driver to .remove_new in preparation for kernel 6.12 support.
    
    Signed-off-by: Mieczyslaw Nalewaj <namiltd at yahoo.com>
    Link: https://github.com/openwrt/openwrt/pull/18535
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ramips/files/drivers/dma/mediatek/hsdma-mt7621.c       | 6 ++----
 target/linux/ramips/files/drivers/dma/ralink-gdma.c                 | 6 ++----
 target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c             | 6 ++----
 target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c        | 6 ++----
 target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c  | 6 ++----
 target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c  | 6 ++----
 target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c | 6 ++----
 7 files changed, 14 insertions(+), 28 deletions(-)

diff --git a/target/linux/ramips/files/drivers/dma/mediatek/hsdma-mt7621.c b/target/linux/ramips/files/drivers/dma/mediatek/hsdma-mt7621.c
index a3a9a7f4ae..b99b4a920f 100644
--- a/target/linux/ramips/files/drivers/dma/mediatek/hsdma-mt7621.c
+++ b/target/linux/ramips/files/drivers/dma/mediatek/hsdma-mt7621.c
@@ -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,
diff --git a/target/linux/ramips/files/drivers/dma/ralink-gdma.c b/target/linux/ramips/files/drivers/dma/ralink-gdma.c
index e510a05ebb..41220d83dd 100644
--- a/target/linux/ramips/files/drivers/dma/ralink-gdma.c
+++ b/target/linux/ramips/files/drivers/dma/ralink-gdma.c
@@ -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,
diff --git a/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c b/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c
index a9c242bfd3..fc89fa5f8b 100644
--- a/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c
+++ b/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c
@@ -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,
diff --git a/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c b/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
index 0ac191ea66..bd071c9ec3 100644
--- a/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
+++ b/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
@@ -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,
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
index bbb52d74b2..9181ebba5c 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
@@ -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,
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 154983494e..593caaa6a7 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
@@ -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,
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 4dff1340d7..5a8e92ab12 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
@@ -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,




More information about the lede-commits mailing list