ipq40xx: qca8k: use remove_new

Easy compability fix for kernel 6.12.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18660
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
Rosen Penev 2025-04-26 15:49:32 -07:00 committed by Christian Marangi
parent 745b720c6b
commit 672caaf203
No known key found for this signature in database
GPG key ID: AC001D09ADBFEAD7

View file

@ -78,7 +78,7 @@ Signed-off-by: Robert Marko <robert.marko@sartura.hr>
if (dsa_is_cpu_port(priv->ds, i)) if (dsa_is_cpu_port(priv->ds, i))
--- /dev/null --- /dev/null
+++ b/drivers/net/dsa/qca/qca8k-ipq4019.c +++ b/drivers/net/dsa/qca/qca8k-ipq4019.c
@@ -0,0 +1,950 @@ @@ -0,0 +1,948 @@
+// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0
+/* +/*
+ * Copyright (C) 2009 Felix Fietkau <nbd@nbd.name> + * Copyright (C) 2009 Felix Fietkau <nbd@nbd.name>
@ -990,14 +990,14 @@ Signed-off-by: Robert Marko <robert.marko@sartura.hr>
+ return dsa_register_switch(priv->ds); + return dsa_register_switch(priv->ds);
+} +}
+ +
+static int +static void
+qca8k_ipq4019_remove(struct platform_device *pdev) +qca8k_ipq4019_remove(struct platform_device *pdev)
+{ +{
+ struct qca8k_priv *priv = dev_get_drvdata(&pdev->dev); + struct qca8k_priv *priv = dev_get_drvdata(&pdev->dev);
+ int i; + int i;
+ +
+ if (!priv) + if (!priv)
+ return 0; + return;
+ +
+ for (i = 0; i < QCA8K_IPQ4019_NUM_PORTS; i++) + for (i = 0; i < QCA8K_IPQ4019_NUM_PORTS; i++)
+ qca8k_port_set_status(priv, i, 0); + qca8k_port_set_status(priv, i, 0);
@ -1005,8 +1005,6 @@ Signed-off-by: Robert Marko <robert.marko@sartura.hr>
+ dsa_unregister_switch(priv->ds); + dsa_unregister_switch(priv->ds);
+ +
+ platform_set_drvdata(pdev, NULL); + platform_set_drvdata(pdev, NULL);
+
+ return 0;
+} +}
+ +
+static const struct of_device_id qca8k_ipq4019_of_match[] = { +static const struct of_device_id qca8k_ipq4019_of_match[] = {
@ -1016,7 +1014,7 @@ Signed-off-by: Robert Marko <robert.marko@sartura.hr>
+ +
+static struct platform_driver qca8k_ipq4019_driver = { +static struct platform_driver qca8k_ipq4019_driver = {
+ .probe = qca8k_ipq4019_probe, + .probe = qca8k_ipq4019_probe,
+ .remove = qca8k_ipq4019_remove, + .remove_new = qca8k_ipq4019_remove,
+ .driver = { + .driver = {
+ .name = "qca8k-ipq4019", + .name = "qca8k-ipq4019",
+ .of_match_table = qca8k_ipq4019_of_match, + .of_match_table = qca8k_ipq4019_of_match,