[openwrt/openwrt] realtek: use remove_new

LEDE Commits lede-commits at lists.infradead.org
Thu May 1 16:34:42 PDT 2025


ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/576278a5075ea8367f1085e6e5bcc2637c58832f

commit 576278a5075ea8367f1085e6e5bcc2637c58832f
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Apr 26 15:34:51 2025 -0700

    realtek: use remove_new
    
    Easy compability fix for kernel 6.12.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/18660
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 target/linux/mediatek/files-6.6/drivers/net/dsa/an8855.c      | 11 ++++-------
 .../linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/common.c  |  6 ++----
 .../realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c      |  6 ++----
 .../files-6.6/drivers/net/ethernet/siflower/sf_dpns.c         |  7 +++----
 4 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/target/linux/mediatek/files-6.6/drivers/net/dsa/an8855.c b/target/linux/mediatek/files-6.6/drivers/net/dsa/an8855.c
index 7dd62e1a86..e6666d2011 100644
--- a/target/linux/mediatek/files-6.6/drivers/net/dsa/an8855.c
+++ b/target/linux/mediatek/files-6.6/drivers/net/dsa/an8855.c
@@ -2278,15 +2278,12 @@ static int an8855_switch_probe(struct platform_device *pdev)
 	return dsa_register_switch(priv->ds);
 }
 
-static int an8855_switch_remove(struct platform_device *pdev)
+static void an8855_switch_remove(struct platform_device *pdev)
 {
 	struct an8855_priv *priv = dev_get_drvdata(&pdev->dev);
 
-	if (!priv)
-		return 0;
-
-	dsa_unregister_switch(priv->ds);
-	return 0;
+	if (priv)
+		dsa_unregister_switch(priv->ds);
 }
 
 static const struct of_device_id an8855_switch_of_match[] = {
@@ -2297,7 +2294,7 @@ MODULE_DEVICE_TABLE(of, an8855_switch_of_match);
 
 static struct platform_driver an8855_switch_driver = {
 	.probe = an8855_switch_probe,
-	.remove = an8855_switch_remove,
+	.remove_new = an8855_switch_remove,
 	.driver = {
 		.name = "an8855-switch",
 		.of_match_table = an8855_switch_of_match,
diff --git a/target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/common.c
index cd532a7d3d..9d37cccabf 100644
--- a/target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/common.c
+++ b/target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/common.c
@@ -1718,12 +1718,10 @@ err_register_nb:
 	return err;
 }
 
-static int rtl83xx_sw_remove(struct platform_device *pdev)
+static void rtl83xx_sw_remove(struct platform_device *pdev)
 {
 	/* TODO: */
 	pr_debug("Removing platform driver for rtl83xx-sw\n");
-
-	return 0;
 }
 
 static const struct of_device_id rtl83xx_switch_of_ids[] = {
@@ -1736,7 +1734,7 @@ MODULE_DEVICE_TABLE(of, rtl83xx_switch_of_ids);
 
 static struct platform_driver rtl83xx_switch_driver = {
 	.probe = rtl83xx_sw_probe,
-	.remove = rtl83xx_sw_remove,
+	.remove_new = rtl83xx_sw_remove,
 	.driver = {
 		.name = "rtl83xx-switch",
 		.pm = NULL,
diff --git a/target/linux/realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c
index 4b79090696..e7297ca151 100644
--- a/target/linux/realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c
@@ -2656,7 +2656,7 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int rtl838x_eth_remove(struct platform_device *pdev)
+static void rtl838x_eth_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct rtl838x_eth_priv *priv = netdev_priv(dev);
@@ -2670,8 +2670,6 @@ static int rtl838x_eth_remove(struct platform_device *pdev)
 		for (int i = 0; i < priv->rxrings; i++)
 			netif_napi_del(&priv->rx_qs[i].napi);
 	}
-
-	return 0;
 }
 
 static const struct of_device_id rtl838x_eth_of_ids[] = {
@@ -2682,7 +2680,7 @@ MODULE_DEVICE_TABLE(of, rtl838x_eth_of_ids);
 
 static struct platform_driver rtl838x_eth_driver = {
 	.probe = rtl838x_eth_probe,
-	.remove = rtl838x_eth_remove,
+	.remove_new = rtl838x_eth_remove,
 	.driver = {
 		.name = "rtl838x-eth",
 		.pm = NULL,
diff --git a/target/linux/siflower/files-6.6/drivers/net/ethernet/siflower/sf_dpns.c b/target/linux/siflower/files-6.6/drivers/net/ethernet/siflower/sf_dpns.c
index 092c7d4425..4e00b5b7dd 100644
--- a/target/linux/siflower/files-6.6/drivers/net/ethernet/siflower/sf_dpns.c
+++ b/target/linux/siflower/files-6.6/drivers/net/ethernet/siflower/sf_dpns.c
@@ -49,11 +49,10 @@ static int dpns_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int dpns_remove(struct platform_device *pdev) {
+static void dpns_remove(struct platform_device *pdev) {
 	struct dpns_priv *priv = platform_get_drvdata(pdev);
 	debugfs_remove_recursive(priv->debugfs);
 	reset_control_assert(priv->npu_rst);
-	return 0;
 }
 
 static const struct of_device_id dpns_match[] = {
@@ -64,7 +63,7 @@ MODULE_DEVICE_TABLE(of, dpns_match);
 
 static struct platform_driver dpns_driver = {
 	.probe	= dpns_probe,
-	.remove = dpns_remove,
+	.remove_new = dpns_remove,
 	.driver	= {
 		.name		= "sfdpns",
 		.of_match_table	= dpns_match,
@@ -74,4 +73,4 @@ module_platform_driver(dpns_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Qingfang Deng <qingfang.deng at siflower.com.cn>");
-MODULE_DESCRIPTION("NPU stub driver for SF21A6826/SF21H8898 SoC");
\ No newline at end of file
+MODULE_DESCRIPTION("NPU stub driver for SF21A6826/SF21H8898 SoC");




More information about the lede-commits mailing list