linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/19] can: Convert to platform remove callback returning void
@ 2023-05-12 21:27 Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 01/19] can: at91_can: " Uwe Kleine-König
                   ` (19 more replies)
  0 siblings, 20 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Dario Binacchi,
	Uwe Kleine-König, Minghao Chi, Zhang Changzhong, Wei Fang,
	Rob Herring, Pavel Pisa, Ondrej Ille, Vincent Mailhol,
	Haibo Chen, Oliver Hartkopp, Yang Yingliang,
	Chandrasekar Ramakrishnan, Chris Packham, Andy Shevchenko,
	Wolfram Sang, Mark Brown, Dongliang Mu, Geert Uytterhoeven,
	Biju Das, Simon Horman, Christophe JAILLET, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Appana Durga Kedareswara rao,
	Michal Simek
  Cc: linux-can, netdev, linux-arm-kernel, kernel, linux-sunxi,
	Naga Sureshkumar Relli

Hello,

this series convers the drivers below drivers/net/can to the
.remove_new() callback of struct platform_driver(). The motivation is to
make the remove callback less prone for errors and wrong assumptions.
See commit 5c5a7680e67b ("platform: Provide a remove callback that
returns no value") for a more detailed rationale.

All drivers already returned zero unconditionally in their
.remove() callback, so converting them to .remove_new() is trivial.

Best regards
Uwe

Uwe Kleine-König (19):
  can: at91_can: Convert to platform remove callback returning void
  can: bxcan: Convert to platform remove callback returning void
  can: c_can: Convert to platform remove callback returning void
  can: cc770_isa: Convert to platform remove callback returning void
  can: cc770_platform: Convert to platform remove callback returning void
  can: ctucanfd: Convert to platform remove callback returning void
  can: flexcan: Convert to platform remove callback returning void
  can: grcan: Convert to platform remove callback returning void
  can: ifi_canfd: Convert to platform remove callback returning void
  can: janz-ican3: Convert to platform remove callback returning void
  can: m_can: Convert to platform remove callback returning void
  can: mscan/mpc5xxx_can.c -- Convert to platform remove callback returning void
  can: rcar: Convert to platform remove callback returning void
  can: sja1000_isa: Convert to platform remove callback returning void
  can: sja1000_platform: Convert to platform remove callback returning void
  can: softing: Convert to platform remove callback returning void
  can: sun4i_can: Convert to platform remove callback returning void
  can: ti_hecc: Convert to platform remove callback returning void
  can: xilinx: Convert to platform remove callback returning void

 drivers/net/can/at91_can.c                   | 6 ++----
 drivers/net/can/bxcan.c                      | 5 ++---
 drivers/net/can/c_can/c_can_platform.c       | 6 ++----
 drivers/net/can/cc770/cc770_isa.c            | 6 ++----
 drivers/net/can/cc770/cc770_platform.c       | 6 ++----
 drivers/net/can/ctucanfd/ctucanfd_platform.c | 6 ++----
 drivers/net/can/flexcan/flexcan-core.c       | 6 ++----
 drivers/net/can/grcan.c                      | 6 ++----
 drivers/net/can/ifi_canfd/ifi_canfd.c        | 6 ++----
 drivers/net/can/janz-ican3.c                 | 6 ++----
 drivers/net/can/m_can/m_can_platform.c       | 6 ++----
 drivers/net/can/mscan/mpc5xxx_can.c          | 6 ++----
 drivers/net/can/rcar/rcar_can.c              | 5 ++---
 drivers/net/can/rcar/rcar_canfd.c            | 6 ++----
 drivers/net/can/sja1000/sja1000_isa.c        | 6 ++----
 drivers/net/can/sja1000/sja1000_platform.c   | 6 ++----
 drivers/net/can/softing/softing_main.c       | 5 ++---
 drivers/net/can/sun4i_can.c                  | 6 ++----
 drivers/net/can/ti_hecc.c                    | 6 ++----
 drivers/net/can/xilinx_can.c                 | 6 ++----
 20 files changed, 40 insertions(+), 77 deletions(-)


base-commit: ac9a78681b921877518763ba0e89202254349d1b
-- 
2.39.2


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 01/19] can: at91_can: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-15  6:48   ` Claudiu.Beznea
  2023-05-12 21:27 ` [PATCH 02/19] can: bxcan: " Uwe Kleine-König
                   ` (18 subsequent siblings)
  19 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea
  Cc: linux-can, netdev, linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/at91_can.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index 199cb200f2bd..4621266851ed 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -1346,7 +1346,7 @@ static int at91_can_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int at91_can_remove(struct platform_device *pdev)
+static void at91_can_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct at91_priv *priv = netdev_priv(dev);
@@ -1362,8 +1362,6 @@ static int at91_can_remove(struct platform_device *pdev)
 	clk_put(priv->clk);
 
 	free_candev(dev);
-
-	return 0;
 }
 
 static const struct platform_device_id at91_can_id_table[] = {
@@ -1381,7 +1379,7 @@ MODULE_DEVICE_TABLE(platform, at91_can_id_table);
 
 static struct platform_driver at91_can_driver = {
 	.probe = at91_can_probe,
-	.remove = at91_can_remove,
+	.remove_new = at91_can_remove,
 	.driver = {
 		.name = KBUILD_MODNAME,
 		.of_match_table = of_match_ptr(at91_can_dt_ids),
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 02/19] can: bxcan: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 01/19] can: at91_can: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 03/19] can: c_can: " Uwe Kleine-König
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Dario Binacchi, Wolfgang Grandegger, Marc Kleine-Budde,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/bxcan.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/bxcan.c b/drivers/net/can/bxcan.c
index e26ccd41e3cb..75091480e08e 100644
--- a/drivers/net/can/bxcan.c
+++ b/drivers/net/can/bxcan.c
@@ -1027,7 +1027,7 @@ static int bxcan_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int bxcan_remove(struct platform_device *pdev)
+static void bxcan_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct bxcan_priv *priv = netdev_priv(ndev);
@@ -1036,7 +1036,6 @@ static int bxcan_remove(struct platform_device *pdev)
 	clk_disable_unprepare(priv->clk);
 	can_rx_offload_del(&priv->offload);
 	free_candev(ndev);
-	return 0;
 }
 
 static int __maybe_unused bxcan_suspend(struct device *dev)
@@ -1088,7 +1087,7 @@ static struct platform_driver bxcan_driver = {
 		.of_match_table = bxcan_of_match,
 	},
 	.probe = bxcan_probe,
-	.remove = bxcan_remove,
+	.remove_new = bxcan_remove,
 };
 
 module_platform_driver(bxcan_driver);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 03/19] can: c_can: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 01/19] can: at91_can: " Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 02/19] can: bxcan: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 04/19] can: cc770_isa: " Uwe Kleine-König
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Uwe Kleine-König,
	Minghao Chi
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/c_can/c_can_platform.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index 03ccb7cfacaf..925930b6c4ca 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -410,7 +410,7 @@ static int c_can_plat_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int c_can_plat_remove(struct platform_device *pdev)
+static void c_can_plat_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct c_can_priv *priv = netdev_priv(dev);
@@ -418,8 +418,6 @@ static int c_can_plat_remove(struct platform_device *pdev)
 	unregister_c_can_dev(dev);
 	pm_runtime_disable(priv->device);
 	free_c_can_dev(dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -487,7 +485,7 @@ static struct platform_driver c_can_plat_driver = {
 		.of_match_table = c_can_of_table,
 	},
 	.probe = c_can_plat_probe,
-	.remove = c_can_plat_remove,
+	.remove_new = c_can_plat_remove,
 	.suspend = c_can_suspend,
 	.resume = c_can_resume,
 	.id_table = c_can_id_table,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 04/19] can: cc770_isa: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 03/19] can: c_can: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 05/19] can: cc770_platform: " Uwe Kleine-König
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Uwe Kleine-König,
	Zhang Changzhong
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/cc770/cc770_isa.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/cc770/cc770_isa.c b/drivers/net/can/cc770/cc770_isa.c
index 8f6dccd5a587..22009440a983 100644
--- a/drivers/net/can/cc770/cc770_isa.c
+++ b/drivers/net/can/cc770/cc770_isa.c
@@ -285,7 +285,7 @@ static int cc770_isa_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int cc770_isa_remove(struct platform_device *pdev)
+static void cc770_isa_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct cc770_priv *priv = netdev_priv(dev);
@@ -303,13 +303,11 @@ static int cc770_isa_remove(struct platform_device *pdev)
 			release_region(port[idx], CC770_IOSIZE);
 	}
 	free_cc770dev(dev);
-
-	return 0;
 }
 
 static struct platform_driver cc770_isa_driver = {
 	.probe = cc770_isa_probe,
-	.remove = cc770_isa_remove,
+	.remove_new = cc770_isa_remove,
 	.driver = {
 		.name = KBUILD_MODNAME,
 	},
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 05/19] can: cc770_platform: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (3 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 04/19] can: cc770_isa: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 06/19] can: ctucanfd: " Uwe Kleine-König
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Wei Fang,
	Uwe Kleine-König, Rob Herring
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/cc770/cc770_platform.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/cc770/cc770_platform.c b/drivers/net/can/cc770/cc770_platform.c
index 8dcc32e4e30e..13bcfba05f18 100644
--- a/drivers/net/can/cc770/cc770_platform.c
+++ b/drivers/net/can/cc770/cc770_platform.c
@@ -230,7 +230,7 @@ static int cc770_platform_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int cc770_platform_remove(struct platform_device *pdev)
+static void cc770_platform_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct cc770_priv *priv = netdev_priv(dev);
@@ -242,8 +242,6 @@ static int cc770_platform_remove(struct platform_device *pdev)
 
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	release_mem_region(mem->start, resource_size(mem));
-
-	return 0;
 }
 
 static const struct of_device_id cc770_platform_table[] = {
@@ -259,7 +257,7 @@ static struct platform_driver cc770_platform_driver = {
 		.of_match_table = cc770_platform_table,
 	},
 	.probe = cc770_platform_probe,
-	.remove = cc770_platform_remove,
+	.remove_new = cc770_platform_remove,
 };
 
 module_platform_driver(cc770_platform_driver);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 06/19] can: ctucanfd: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (4 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 05/19] can: cc770_platform: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-14 13:50   ` Pavel Pisa
  2023-05-12 21:27 ` [PATCH 07/19] can: flexcan: " Uwe Kleine-König
                   ` (13 subsequent siblings)
  19 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Pavel Pisa, Ondrej Ille, Wolfgang Grandegger, Marc Kleine-Budde,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/ctucanfd/ctucanfd_platform.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/ctucanfd/ctucanfd_platform.c b/drivers/net/can/ctucanfd/ctucanfd_platform.c
index a17561d97192..55bb10b157b4 100644
--- a/drivers/net/can/ctucanfd/ctucanfd_platform.c
+++ b/drivers/net/can/ctucanfd/ctucanfd_platform.c
@@ -86,7 +86,7 @@ static int ctucan_platform_probe(struct platform_device *pdev)
  * This function frees all the resources allocated to the device.
  * Return: 0 always
  */
-static int ctucan_platform_remove(struct platform_device *pdev)
+static void ctucan_platform_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct ctucan_priv *priv = netdev_priv(ndev);
@@ -97,8 +97,6 @@ static int ctucan_platform_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 	netif_napi_del(&priv->napi);
 	free_candev(ndev);
-
-	return 0;
 }
 
 static SIMPLE_DEV_PM_OPS(ctucan_platform_pm_ops, ctucan_suspend, ctucan_resume);
@@ -113,7 +111,7 @@ MODULE_DEVICE_TABLE(of, ctucan_of_match);
 
 static struct platform_driver ctucanfd_driver = {
 	.probe	= ctucan_platform_probe,
-	.remove	= ctucan_platform_remove,
+	.remove_new = ctucan_platform_remove,
 	.driver	= {
 		.name = DRV_NAME,
 		.pm = &ctucan_platform_pm_ops,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 07/19] can: flexcan: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (5 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 06/19] can: ctucanfd: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 08/19] can: grcan: " Uwe Kleine-König
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Vincent Mailhol,
	Uwe Kleine-König, Haibo Chen, Oliver Hartkopp,
	Yang Yingliang
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/flexcan/flexcan-core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c
index 6d638c93977b..ff0fc18baf13 100644
--- a/drivers/net/can/flexcan/flexcan-core.c
+++ b/drivers/net/can/flexcan/flexcan-core.c
@@ -2218,7 +2218,7 @@ static int flexcan_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int flexcan_remove(struct platform_device *pdev)
+static void flexcan_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 
@@ -2227,8 +2227,6 @@ static int flexcan_remove(struct platform_device *pdev)
 	unregister_flexcandev(dev);
 	pm_runtime_disable(&pdev->dev);
 	free_candev(dev);
-
-	return 0;
 }
 
 static int __maybe_unused flexcan_suspend(struct device *device)
@@ -2379,7 +2377,7 @@ static struct platform_driver flexcan_driver = {
 		.of_match_table = flexcan_of_match,
 	},
 	.probe = flexcan_probe,
-	.remove = flexcan_remove,
+	.remove_new = flexcan_remove,
 	.id_table = flexcan_id_table,
 };
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 08/19] can: grcan: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (6 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 07/19] can: flexcan: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 09/19] can: ifi_canfd: " Uwe Kleine-König
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/grcan.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c
index 4bedcc3eea0d..3174efdae271 100644
--- a/drivers/net/can/grcan.c
+++ b/drivers/net/can/grcan.c
@@ -1696,7 +1696,7 @@ static int grcan_probe(struct platform_device *ofdev)
 	return err;
 }
 
-static int grcan_remove(struct platform_device *ofdev)
+static void grcan_remove(struct platform_device *ofdev)
 {
 	struct net_device *dev = platform_get_drvdata(ofdev);
 	struct grcan_priv *priv = netdev_priv(dev);
@@ -1706,8 +1706,6 @@ static int grcan_remove(struct platform_device *ofdev)
 	irq_dispose_mapping(dev->irq);
 	netif_napi_del(&priv->napi);
 	free_candev(dev);
-
-	return 0;
 }
 
 static const struct of_device_id grcan_match[] = {
@@ -1726,7 +1724,7 @@ static struct platform_driver grcan_driver = {
 		.of_match_table = grcan_match,
 	},
 	.probe = grcan_probe,
-	.remove = grcan_remove,
+	.remove_new = grcan_remove,
 };
 
 module_platform_driver(grcan_driver);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 09/19] can: ifi_canfd: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (7 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 08/19] can: grcan: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 10/19] can: janz-ican3: " Uwe Kleine-König
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Vincent Mailhol,
	Oliver Hartkopp, Uwe Kleine-König
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/ifi_canfd/ifi_canfd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/ifi_canfd/ifi_canfd.c b/drivers/net/can/ifi_canfd/ifi_canfd.c
index 07eaf724a572..1d6642c94f2f 100644
--- a/drivers/net/can/ifi_canfd/ifi_canfd.c
+++ b/drivers/net/can/ifi_canfd/ifi_canfd.c
@@ -1013,15 +1013,13 @@ static int ifi_canfd_plat_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int ifi_canfd_plat_remove(struct platform_device *pdev)
+static void ifi_canfd_plat_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
 
 	unregister_candev(ndev);
 	platform_set_drvdata(pdev, NULL);
 	free_candev(ndev);
-
-	return 0;
 }
 
 static const struct of_device_id ifi_canfd_of_table[] = {
@@ -1036,7 +1034,7 @@ static struct platform_driver ifi_canfd_plat_driver = {
 		.of_match_table	= ifi_canfd_of_table,
 	},
 	.probe	= ifi_canfd_plat_probe,
-	.remove	= ifi_canfd_plat_remove,
+	.remove_new = ifi_canfd_plat_remove,
 };
 
 module_platform_driver(ifi_canfd_plat_driver);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 10/19] can: janz-ican3: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (8 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 09/19] can: ifi_canfd: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 11/19] can: m_can: " Uwe Kleine-König
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/janz-ican3.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 0732a5092141..d048ea565b89 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -2023,7 +2023,7 @@ static int ican3_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int ican3_remove(struct platform_device *pdev)
+static void ican3_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct ican3_dev *mod = netdev_priv(ndev);
@@ -2042,8 +2042,6 @@ static int ican3_remove(struct platform_device *pdev)
 	iounmap(mod->dpm);
 
 	free_candev(ndev);
-
-	return 0;
 }
 
 static struct platform_driver ican3_driver = {
@@ -2051,7 +2049,7 @@ static struct platform_driver ican3_driver = {
 		.name	= DRV_NAME,
 	},
 	.probe		= ican3_probe,
-	.remove		= ican3_remove,
+	.remove_new	= ican3_remove,
 };
 
 module_platform_driver(ican3_driver);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 11/19] can: m_can: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (9 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 10/19] can: janz-ican3: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 12/19] can: mscan/mpc5xxx_can.c -- " Uwe Kleine-König
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Chandrasekar Ramakrishnan, Wolfgang Grandegger,
	Marc Kleine-Budde, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/m_can/m_can_platform.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c
index 9c1dcf838006..94dc82644113 100644
--- a/drivers/net/can/m_can/m_can_platform.c
+++ b/drivers/net/can/m_can/m_can_platform.c
@@ -164,7 +164,7 @@ static __maybe_unused int m_can_resume(struct device *dev)
 	return m_can_class_resume(dev);
 }
 
-static int m_can_plat_remove(struct platform_device *pdev)
+static void m_can_plat_remove(struct platform_device *pdev)
 {
 	struct m_can_plat_priv *priv = platform_get_drvdata(pdev);
 	struct m_can_classdev *mcan_class = &priv->cdev;
@@ -172,8 +172,6 @@ static int m_can_plat_remove(struct platform_device *pdev)
 	m_can_class_unregister(mcan_class);
 
 	m_can_class_free_dev(mcan_class->net);
-
-	return 0;
 }
 
 static int __maybe_unused m_can_runtime_suspend(struct device *dev)
@@ -223,7 +221,7 @@ static struct platform_driver m_can_plat_driver = {
 		.pm     = &m_can_pmops,
 	},
 	.probe = m_can_plat_probe,
-	.remove = m_can_plat_remove,
+	.remove_new = m_can_plat_remove,
 };
 
 module_platform_driver(m_can_plat_driver);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 12/19] can: mscan/mpc5xxx_can.c -- Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (10 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 11/19] can: m_can: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-12 21:37   ` Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 13/19] can: rcar: " Uwe Kleine-König
                   ` (7 subsequent siblings)
  19 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Chris Packham,
	Andy Shevchenko, Wolfram Sang, Mark Brown, Dongliang Mu,
	Uwe Kleine-König
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/mscan/mpc5xxx_can.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index b0ed798ae70f..4837df6efa92 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -349,7 +349,7 @@ static int mpc5xxx_can_probe(struct platform_device *ofdev)
 	return err;
 }
 
-static int mpc5xxx_can_remove(struct platform_device *ofdev)
+static void mpc5xxx_can_remove(struct platform_device *ofdev)
 {
 	const struct of_device_id *match;
 	const struct mpc5xxx_can_data *data;
@@ -365,8 +365,6 @@ static int mpc5xxx_can_remove(struct platform_device *ofdev)
 	iounmap(priv->reg_base);
 	irq_dispose_mapping(dev->irq);
 	free_candev(dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -437,7 +435,7 @@ static struct platform_driver mpc5xxx_can_driver = {
 		.of_match_table = mpc5xxx_can_table,
 	},
 	.probe = mpc5xxx_can_probe,
-	.remove = mpc5xxx_can_remove,
+	.remove_new = mpc5xxx_can_remove,
 #ifdef CONFIG_PM
 	.suspend = mpc5xxx_can_suspend,
 	.resume = mpc5xxx_can_resume,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 13/19] can: rcar: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (11 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 12/19] can: mscan/mpc5xxx_can.c -- " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-15  7:53   ` Geert Uytterhoeven
  2023-05-12 21:27 ` [PATCH 14/19] can: sja1000_isa: " Uwe Kleine-König
                   ` (6 subsequent siblings)
  19 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Vincent Mailhol,
	Oliver Hartkopp, Uwe Kleine-König, Geert Uytterhoeven,
	Biju Das, Simon Horman, Christophe JAILLET
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/rcar/rcar_can.c   | 5 ++---
 drivers/net/can/rcar/rcar_canfd.c | 6 ++----
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/net/can/rcar/rcar_can.c b/drivers/net/can/rcar/rcar_can.c
index cc43c9c5e38c..f5aa5dbacaf2 100644
--- a/drivers/net/can/rcar/rcar_can.c
+++ b/drivers/net/can/rcar/rcar_can.c
@@ -824,7 +824,7 @@ static int rcar_can_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int rcar_can_remove(struct platform_device *pdev)
+static void rcar_can_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct rcar_can_priv *priv = netdev_priv(ndev);
@@ -832,7 +832,6 @@ static int rcar_can_remove(struct platform_device *pdev)
 	unregister_candev(ndev);
 	netif_napi_del(&priv->napi);
 	free_candev(ndev);
-	return 0;
 }
 
 static int __maybe_unused rcar_can_suspend(struct device *dev)
@@ -908,7 +907,7 @@ static struct platform_driver rcar_can_driver = {
 		.pm = &rcar_can_pm_ops,
 	},
 	.probe = rcar_can_probe,
-	.remove = rcar_can_remove,
+	.remove_new = rcar_can_remove,
 };
 
 module_platform_driver(rcar_can_driver);
diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
index 963c42f43755..e4d748913439 100644
--- a/drivers/net/can/rcar/rcar_canfd.c
+++ b/drivers/net/can/rcar/rcar_canfd.c
@@ -2078,7 +2078,7 @@ static int rcar_canfd_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int rcar_canfd_remove(struct platform_device *pdev)
+static void rcar_canfd_remove(struct platform_device *pdev)
 {
 	struct rcar_canfd_global *gpriv = platform_get_drvdata(pdev);
 	u32 ch;
@@ -2096,8 +2096,6 @@ static int rcar_canfd_remove(struct platform_device *pdev)
 	clk_disable_unprepare(gpriv->clkp);
 	reset_control_assert(gpriv->rstc1);
 	reset_control_assert(gpriv->rstc2);
-
-	return 0;
 }
 
 static int __maybe_unused rcar_canfd_suspend(struct device *dev)
@@ -2130,7 +2128,7 @@ static struct platform_driver rcar_canfd_driver = {
 		.pm = &rcar_canfd_pm_ops,
 	},
 	.probe = rcar_canfd_probe,
-	.remove = rcar_canfd_remove,
+	.remove_new = rcar_canfd_remove,
 };
 
 module_platform_driver(rcar_canfd_driver);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 14/19] can: sja1000_isa: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (12 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 13/19] can: rcar: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 15/19] can: sja1000_platform: " Uwe Kleine-König
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Uwe Kleine-König,
	Zhang Changzhong
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/sja1000/sja1000_isa.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/sja1000/sja1000_isa.c b/drivers/net/can/sja1000/sja1000_isa.c
index db3e767d5320..fca5a9a1d857 100644
--- a/drivers/net/can/sja1000/sja1000_isa.c
+++ b/drivers/net/can/sja1000/sja1000_isa.c
@@ -223,7 +223,7 @@ static int sja1000_isa_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int sja1000_isa_remove(struct platform_device *pdev)
+static void sja1000_isa_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct sja1000_priv *priv = netdev_priv(dev);
@@ -241,13 +241,11 @@ static int sja1000_isa_remove(struct platform_device *pdev)
 			release_region(port[idx], SJA1000_IOSIZE);
 	}
 	free_sja1000dev(dev);
-
-	return 0;
 }
 
 static struct platform_driver sja1000_isa_driver = {
 	.probe = sja1000_isa_probe,
-	.remove = sja1000_isa_remove,
+	.remove_new = sja1000_isa_remove,
 	.driver = {
 		.name = DRV_NAME,
 	},
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 15/19] can: sja1000_platform: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (13 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 14/19] can: sja1000_isa: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 16/19] can: softing: " Uwe Kleine-König
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Biju Das,
	Uwe Kleine-König
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/sja1000/sja1000_platform.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/sja1000/sja1000_platform.c b/drivers/net/can/sja1000/sja1000_platform.c
index 6779d5357069..b4889b5746e5 100644
--- a/drivers/net/can/sja1000/sja1000_platform.c
+++ b/drivers/net/can/sja1000/sja1000_platform.c
@@ -317,19 +317,17 @@ static int sp_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int sp_remove(struct platform_device *pdev)
+static void sp_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 
 	unregister_sja1000dev(dev);
 	free_sja1000dev(dev);
-
-	return 0;
 }
 
 static struct platform_driver sp_driver = {
 	.probe = sp_probe,
-	.remove = sp_remove,
+	.remove_new = sp_remove,
 	.driver = {
 		.name = DRV_NAME,
 		.of_match_table = sp_of_table,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 16/19] can: softing: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (14 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 15/19] can: sja1000_platform: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 17/19] can: sun4i_can: " Uwe Kleine-König
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Vincent Mailhol,
	Uwe Kleine-König, Oliver Hartkopp
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/softing/softing_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
index c72f505d29fe..bd25137062c5 100644
--- a/drivers/net/can/softing/softing_main.c
+++ b/drivers/net/can/softing/softing_main.c
@@ -729,7 +729,7 @@ static const struct attribute_group softing_pdev_group = {
 /*
  * platform driver
  */
-static int softing_pdev_remove(struct platform_device *pdev)
+static void softing_pdev_remove(struct platform_device *pdev)
 {
 	struct softing *card = platform_get_drvdata(pdev);
 	int j;
@@ -747,7 +747,6 @@ static int softing_pdev_remove(struct platform_device *pdev)
 
 	iounmap(card->dpram);
 	kfree(card);
-	return 0;
 }
 
 static int softing_pdev_probe(struct platform_device *pdev)
@@ -855,7 +854,7 @@ static struct platform_driver softing_driver = {
 		.name = KBUILD_MODNAME,
 	},
 	.probe = softing_pdev_probe,
-	.remove = softing_pdev_remove,
+	.remove_new = softing_pdev_remove,
 };
 
 module_platform_driver(softing_driver);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 17/19] can: sun4i_can: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (15 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 16/19] can: softing: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-13  6:36   ` Jernej Škrabec
  2023-05-14 17:05   ` Gerhard Bertelsmann
  2023-05-12 21:27 ` [PATCH 18/19] can: ti_hecc: " Uwe Kleine-König
                   ` (2 subsequent siblings)
  19 siblings, 2 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland
  Cc: linux-can, netdev, linux-arm-kernel, linux-sunxi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/sun4i_can.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/sun4i_can.c b/drivers/net/can/sun4i_can.c
index 2b78f9197681..0827830bbf28 100644
--- a/drivers/net/can/sun4i_can.c
+++ b/drivers/net/can/sun4i_can.c
@@ -791,14 +791,12 @@ static const struct of_device_id sun4ican_of_match[] = {
 
 MODULE_DEVICE_TABLE(of, sun4ican_of_match);
 
-static int sun4ican_remove(struct platform_device *pdev)
+static void sun4ican_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 
 	unregister_netdev(dev);
 	free_candev(dev);
-
-	return 0;
 }
 
 static int sun4ican_probe(struct platform_device *pdev)
@@ -901,7 +899,7 @@ static struct platform_driver sun4i_can_driver = {
 		.of_match_table = sun4ican_of_match,
 	},
 	.probe = sun4ican_probe,
-	.remove = sun4ican_remove,
+	.remove_new = sun4ican_remove,
 };
 
 module_platform_driver(sun4i_can_driver);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 18/19] can: ti_hecc: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (16 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 17/19] can: sun4i_can: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-12 21:27 ` [PATCH 19/19] can: xilinx: " Uwe Kleine-König
  2023-05-16  7:31 ` [PATCH net-next 00/19] can: " Simon Horman
  19 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: linux-can, netdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/ti_hecc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index 27700f72eac2..9bab0b4cc449 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -963,7 +963,7 @@ static int ti_hecc_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int ti_hecc_remove(struct platform_device *pdev)
+static void ti_hecc_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct ti_hecc_priv *priv = netdev_priv(ndev);
@@ -973,8 +973,6 @@ static int ti_hecc_remove(struct platform_device *pdev)
 	clk_put(priv->clk);
 	can_rx_offload_del(&priv->offload);
 	free_candev(ndev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -1028,7 +1026,7 @@ static struct platform_driver ti_hecc_driver = {
 		.of_match_table = ti_hecc_dt_ids,
 	},
 	.probe = ti_hecc_probe,
-	.remove = ti_hecc_remove,
+	.remove_new = ti_hecc_remove,
 	.suspend = ti_hecc_suspend,
 	.resume = ti_hecc_resume,
 };
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 19/19] can: xilinx: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (17 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 18/19] can: ti_hecc: " Uwe Kleine-König
@ 2023-05-12 21:27 ` Uwe Kleine-König
  2023-05-16  7:31 ` [PATCH net-next 00/19] can: " Simon Horman
  19 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:27 UTC (permalink / raw)
  To: Appana Durga Kedareswara rao, Wolfgang Grandegger,
	Marc Kleine-Budde, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Michal Simek
  Cc: Naga Sureshkumar Relli, linux-can, netdev, linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/xilinx_can.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
index 43c812ea1de0..797c69a0314d 100644
--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
@@ -1898,20 +1898,18 @@ static int xcan_probe(struct platform_device *pdev)
  * This function frees all the resources allocated to the device.
  * Return: 0 always
  */
-static int xcan_remove(struct platform_device *pdev)
+static void xcan_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
 
 	unregister_candev(ndev);
 	pm_runtime_disable(&pdev->dev);
 	free_candev(ndev);
-
-	return 0;
 }
 
 static struct platform_driver xcan_driver = {
 	.probe = xcan_probe,
-	.remove	= xcan_remove,
+	.remove_new = xcan_remove,
 	.driver	= {
 		.name = DRIVER_NAME,
 		.pm = &xcan_dev_pm_ops,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH 12/19] can: mscan/mpc5xxx_can.c -- Convert to platform remove callback returning void
  2023-05-12 21:27 ` [PATCH 12/19] can: mscan/mpc5xxx_can.c -- " Uwe Kleine-König
@ 2023-05-12 21:37   ` Uwe Kleine-König
  0 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-05-12 21:37 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Chris Packham,
	Andy Shevchenko, Wolfram Sang, Mark Brown, Dongliang Mu
  Cc: netdev, kernel, linux-can

[-- Attachment #1: Type: text/plain, Size: 573 bytes --]

Hello,

I fatfingered the subject. I didn't adapt completely in the first rebase
round as I was unsure what to pick and then forgot to fix that before
sending out. Looking at the history the suitable prefix would be

	can: mscan: mpc5xxx_can:

. Feel free to adapt whan applying, otherwise I can resend this patch
individually or the complete series. Just tell me how you prefer it.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 17/19] can: sun4i_can: Convert to platform remove callback returning void
  2023-05-12 21:27 ` [PATCH 17/19] can: sun4i_can: " Uwe Kleine-König
@ 2023-05-13  6:36   ` Jernej Škrabec
  2023-05-14 17:05   ` Gerhard Bertelsmann
  1 sibling, 0 replies; 30+ messages in thread
From: Jernej Škrabec @ 2023-05-13  6:36 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Chen-Yu Tsai,
	Samuel Holland, Uwe Kleine-König
  Cc: linux-can, netdev, linux-arm-kernel, linux-sunxi, kernel

Dne petek, 12. maj 2023 ob 23:27:23 CEST je Uwe Kleine-König napisal(a):
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart from
> emitting a warning) and this typically results in resource leaks. To improve
> here there is a quest to make the remove callback return void. In the first
> step of this quest all drivers are converted to .remove_new() which already
> returns void. Eventually after all drivers are converted, .remove_new() is
> renamed to .remove().
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 06/19] can: ctucanfd: Convert to platform remove callback returning void
  2023-05-12 21:27 ` [PATCH 06/19] can: ctucanfd: " Uwe Kleine-König
@ 2023-05-14 13:50   ` Pavel Pisa
  0 siblings, 0 replies; 30+ messages in thread
From: Pavel Pisa @ 2023-05-14 13:50 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Ondrej Ille, Wolfgang Grandegger, Marc Kleine-Budde,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	linux-can, netdev, kernel

On Friday 12 of May 2023 23:27:12 Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart from
> emitting a warning) and this typically results in resource leaks. To
> improve here there is a quest to make the remove callback return void. In
> the first step of this quest all drivers are converted to .remove_new()
> which already returns void. Eventually after all drivers are converted,
> .remove_new() is renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>

Thanks for maintenace, Pavel.


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 17/19] can: sun4i_can: Convert to platform remove callback returning void
  2023-05-12 21:27 ` [PATCH 17/19] can: sun4i_can: " Uwe Kleine-König
  2023-05-13  6:36   ` Jernej Škrabec
@ 2023-05-14 17:05   ` Gerhard Bertelsmann
  1 sibling, 0 replies; 30+ messages in thread
From: Gerhard Bertelsmann @ 2023-05-14 17:05 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, linux-can, netdev,
	linux-arm-kernel, linux-sunxi, kernel

Am 2023-05-12 23:27, schrieb Uwe Kleine-König:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling 
> by
> returning an error code. However the value returned is ignored (apart 
> from
> emitting a warning) and this typically results in resource leaks. To 
> improve
> here there is a quest to make the remove callback return void. In the 
> first
> step of this quest all drivers are converted to .remove_new() which 
> already
> returns void. Eventually after all drivers are converted, .remove_new() 
> is
> renamed to .remove().
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: Gerhard Bertelsmann <info@gerhard-bertelsmann.de>

Thanks Uwe :-)

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 01/19] can: at91_can: Convert to platform remove callback returning void
  2023-05-12 21:27 ` [PATCH 01/19] can: at91_can: " Uwe Kleine-König
@ 2023-05-15  6:48   ` Claudiu.Beznea
  0 siblings, 0 replies; 30+ messages in thread
From: Claudiu.Beznea @ 2023-05-15  6:48 UTC (permalink / raw)
  To: u.kleine-koenig, wg, mkl, davem, edumazet, kuba, pabeni,
	Nicolas.Ferre, alexandre.belloni
  Cc: linux-can, netdev, linux-arm-kernel, kernel

On 13.05.2023 00:27, Uwe Kleine-König wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart from
> emitting a warning) and this typically results in resource leaks. To improve
> here there is a quest to make the remove callback return void. In the first
> step of this quest all drivers are converted to .remove_new() which already
> returns void. Eventually after all drivers are converted, .remove_new() is
> renamed to .remove().
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>


> ---
>  drivers/net/can/at91_can.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
> index 199cb200f2bd..4621266851ed 100644
> --- a/drivers/net/can/at91_can.c
> +++ b/drivers/net/can/at91_can.c
> @@ -1346,7 +1346,7 @@ static int at91_can_probe(struct platform_device *pdev)
>         return err;
>  }
> 
> -static int at91_can_remove(struct platform_device *pdev)
> +static void at91_can_remove(struct platform_device *pdev)
>  {
>         struct net_device *dev = platform_get_drvdata(pdev);
>         struct at91_priv *priv = netdev_priv(dev);
> @@ -1362,8 +1362,6 @@ static int at91_can_remove(struct platform_device *pdev)
>         clk_put(priv->clk);
> 
>         free_candev(dev);
> -
> -       return 0;
>  }
> 
>  static const struct platform_device_id at91_can_id_table[] = {
> @@ -1381,7 +1379,7 @@ MODULE_DEVICE_TABLE(platform, at91_can_id_table);
> 
>  static struct platform_driver at91_can_driver = {
>         .probe = at91_can_probe,
> -       .remove = at91_can_remove,
> +       .remove_new = at91_can_remove,
>         .driver = {
>                 .name = KBUILD_MODNAME,
>                 .of_match_table = of_match_ptr(at91_can_dt_ids),
> --
> 2.39.2
> 


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 13/19] can: rcar: Convert to platform remove callback returning void
  2023-05-12 21:27 ` [PATCH 13/19] can: rcar: " Uwe Kleine-König
@ 2023-05-15  7:53   ` Geert Uytterhoeven
  0 siblings, 0 replies; 30+ messages in thread
From: Geert Uytterhoeven @ 2023-05-15  7:53 UTC (permalink / raw)
  To: u.kleine-koenig
  Cc: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Vincent Mailhol,
	Oliver Hartkopp, Geert Uytterhoeven, Biju Das, Simon Horman,
	Christophe JAILLET, linux-can, netdev, kernel

On Fri, May 12, 2023 at 11:27 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart from
> emitting a warning) and this typically results in resource leaks. To improve
> here there is a quest to make the remove callback return void. In the first
> step of this quest all drivers are converted to .remove_new() which already
> returns void. Eventually after all drivers are converted, .remove_new() is
> renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove

these drivers

> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH net-next 00/19] can: Convert to platform remove callback returning void
  2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (18 preceding siblings ...)
  2023-05-12 21:27 ` [PATCH 19/19] can: xilinx: " Uwe Kleine-König
@ 2023-05-16  7:31 ` Simon Horman
  2023-05-16  8:45   ` Simon Horman
  19 siblings, 1 reply; 30+ messages in thread
From: Simon Horman @ 2023-05-16  7:31 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Dario Binacchi, Minghao Chi,
	Zhang Changzhong, Wei Fang, Rob Herring, Pavel Pisa, Ondrej Ille,
	Vincent Mailhol, Haibo Chen, Oliver Hartkopp, Yang Yingliang,
	Chandrasekar Ramakrishnan, Chris Packham, Andy Shevchenko,
	Wolfram Sang, Mark Brown, Dongliang Mu, Geert Uytterhoeven,
	Biju Das, Christophe JAILLET, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Appana Durga Kedareswara rao, Michal Simek,
	linux-can, netdev, linux-arm-kernel, kernel, linux-sunxi,
	Naga Sureshkumar Relli

On Fri, May 12, 2023 at 11:27:06PM +0200, Uwe Kleine-König wrote:
> Hello,
> 
> this series convers the drivers below drivers/net/can to the
> .remove_new() callback of struct platform_driver(). The motivation is to
> make the remove callback less prone for errors and wrong assumptions.
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for a more detailed rationale.
> 
> All drivers already returned zero unconditionally in their
> .remove() callback, so converting them to .remove_new() is trivial.

Hi Uwe,

I like these changes and they all look good to me.
However, I have a question, perhaps more directed at the netdev
maintainers than yourself.

In principle patch-sets for netdev should not include more than 15 patches.
It's unclear to me if, on the basis of that, this patchset should
be split up. Or if, f.e. given the simple nature of the patches,
an exception applies in this case. Or something else.

I have no fixed opinion on this.
But I feel that the question should be asked.

Link: https://kernel.org/doc/html/v6.1/process/maintainer-netdev.html

...

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH net-next 00/19] can: Convert to platform remove callback returning void
  2023-05-16  7:31 ` [PATCH net-next 00/19] can: " Simon Horman
@ 2023-05-16  8:45   ` Simon Horman
  2023-05-16  8:54     ` Marc Kleine-Budde
  0 siblings, 1 reply; 30+ messages in thread
From: Simon Horman @ 2023-05-16  8:45 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Dario Binacchi, Minghao Chi,
	Zhang Changzhong, Wei Fang, Rob Herring, Pavel Pisa, Ondrej Ille,
	Vincent Mailhol, Haibo Chen, Oliver Hartkopp, Yang Yingliang,
	Chandrasekar Ramakrishnan, Chris Packham, Andy Shevchenko,
	Wolfram Sang, Mark Brown, Dongliang Mu, Geert Uytterhoeven,
	Biju Das, Christophe JAILLET, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Appana Durga Kedareswara rao, Michal Simek,
	linux-can, netdev, linux-arm-kernel, kernel, linux-sunxi,
	Naga Sureshkumar Relli

On Tue, May 16, 2023 at 09:31:04AM +0200, Simon Horman wrote:
> On Fri, May 12, 2023 at 11:27:06PM +0200, Uwe Kleine-König wrote:
> > Hello,
> > 
> > this series convers the drivers below drivers/net/can to the
> > .remove_new() callback of struct platform_driver(). The motivation is to
> > make the remove callback less prone for errors and wrong assumptions.
> > See commit 5c5a7680e67b ("platform: Provide a remove callback that
> > returns no value") for a more detailed rationale.
> > 
> > All drivers already returned zero unconditionally in their
> > .remove() callback, so converting them to .remove_new() is trivial.
> 
> Hi Uwe,
> 
> I like these changes and they all look good to me.
> However, I have a question, perhaps more directed at the netdev
> maintainers than yourself.
> 
> In principle patch-sets for netdev should not include more than 15 patches.
> It's unclear to me if, on the basis of that, this patchset should
> be split up. Or if, f.e. given the simple nature of the patches,
> an exception applies in this case. Or something else.
> 
> I have no fixed opinion on this.
> But I feel that the question should be asked.
> 
> Link: https://kernel.org/doc/html/v6.1/process/maintainer-netdev.html
> 
> ...

I now realise this series is for can.
Which I assume means the guidance above doesn't apply.

Sorry for the noise.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH net-next 00/19] can: Convert to platform remove callback returning void
  2023-05-16  8:45   ` Simon Horman
@ 2023-05-16  8:54     ` Marc Kleine-Budde
  2023-05-16  8:56       ` Marc Kleine-Budde
  0 siblings, 1 reply; 30+ messages in thread
From: Marc Kleine-Budde @ 2023-05-16  8:54 UTC (permalink / raw)
  To: Simon Horman
  Cc: Uwe Kleine-König, Wolfgang Grandegger, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Dario Binacchi, Minghao Chi,
	Zhang Changzhong, Wei Fang, Rob Herring, Pavel Pisa, Ondrej Ille,
	Vincent Mailhol, Haibo Chen, Oliver Hartkopp, Yang Yingliang,
	Chandrasekar Ramakrishnan, Chris Packham, Andy Shevchenko,
	Wolfram Sang, Mark Brown, Dongliang Mu, Geert Uytterhoeven,
	Biju Das, Christophe JAILLET, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Appana Durga Kedareswara rao, Michal Simek,
	linux-can, netdev, linux-arm-kernel, kernel, linux-sunxi,
	Naga Sureshkumar Relli

[-- Attachment #1: Type: text/plain, Size: 1911 bytes --]

On 16.05.2023 10:45:23, Simon Horman wrote:
> On Tue, May 16, 2023 at 09:31:04AM +0200, Simon Horman wrote:
> > On Fri, May 12, 2023 at 11:27:06PM +0200, Uwe Kleine-König wrote:
> > > Hello,
> > > 
> > > this series convers the drivers below drivers/net/can to the
> > > .remove_new() callback of struct platform_driver(). The motivation is to
> > > make the remove callback less prone for errors and wrong assumptions.
> > > See commit 5c5a7680e67b ("platform: Provide a remove callback that
> > > returns no value") for a more detailed rationale.
> > > 
> > > All drivers already returned zero unconditionally in their
> > > .remove() callback, so converting them to .remove_new() is trivial.
> > 
> > Hi Uwe,
> > 
> > I like these changes and they all look good to me.
> > However, I have a question, perhaps more directed at the netdev
> > maintainers than yourself.
> > 
> > In principle patch-sets for netdev should not include more than 15 patches.
> > It's unclear to me if, on the basis of that, this patchset should
> > be split up. Or if, f.e. given the simple nature of the patches,
> > an exception applies in this case. Or something else.
> > 
> > I have no fixed opinion on this.
> > But I feel that the question should be asked.
> > 
> > Link: https://kernel.org/doc/html/v6.1/process/maintainer-netdev.html
> > 
> > ...
> 
> I now realise this series is for can.
> Which I assume means the guidance above doesn't apply.
> 
> Sorry for the noise.

That's still a good point, because sooner or later Uwe will probably
also convert the platform drivers to Driver/Network/Ethernet.

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH net-next 00/19] can: Convert to platform remove callback returning void
  2023-05-16  8:54     ` Marc Kleine-Budde
@ 2023-05-16  8:56       ` Marc Kleine-Budde
  0 siblings, 0 replies; 30+ messages in thread
From: Marc Kleine-Budde @ 2023-05-16  8:56 UTC (permalink / raw)
  To: Simon Horman
  Cc: Alexandre Belloni, Jernej Skrabec, Geert Uytterhoeven,
	Zhang Changzhong, Eric Dumazet, Haibo Chen, Dario Binacchi,
	Rob Herring, Samuel Holland, Minghao Chi, Chen-Yu Tsai,
	Dongliang Mu, linux-arm-kernel, Yang Yingliang, Jakub Kicinski,
	Paolo Abeni, linux-sunxi, Wolfgang Grandegger, Pavel Pisa,
	Naga Sureshkumar Relli, Uwe Kleine-König, linux-can,
	Chris Packham, Wei Fang, Appana Durga Kedareswara rao, Biju Das,
	Andy Shevchenko, Michal Simek, Vincent Mailhol,
	Chandrasekar Ramakrishnan, Oliver Hartkopp, Nicolas Ferre,
	David S. Miller, Wolfram Sang, Ondrej Ille, Mark Brown, kernel,
	netdev, Christophe JAILLET, Claudiu Beznea

[-- Attachment #1: Type: text/plain, Size: 2093 bytes --]

On 16.05.2023 10:54:06, Marc Kleine-Budde wrote:
> On 16.05.2023 10:45:23, Simon Horman wrote:
> > On Tue, May 16, 2023 at 09:31:04AM +0200, Simon Horman wrote:
> > > On Fri, May 12, 2023 at 11:27:06PM +0200, Uwe Kleine-König wrote:
> > > > Hello,
> > > > 
> > > > this series convers the drivers below drivers/net/can to the
> > > > .remove_new() callback of struct platform_driver(). The motivation is to
> > > > make the remove callback less prone for errors and wrong assumptions.
> > > > See commit 5c5a7680e67b ("platform: Provide a remove callback that
> > > > returns no value") for a more detailed rationale.
> > > > 
> > > > All drivers already returned zero unconditionally in their
> > > > .remove() callback, so converting them to .remove_new() is trivial.
> > > 
> > > Hi Uwe,
> > > 
> > > I like these changes and they all look good to me.
> > > However, I have a question, perhaps more directed at the netdev
> > > maintainers than yourself.
> > > 
> > > In principle patch-sets for netdev should not include more than 15 patches.
> > > It's unclear to me if, on the basis of that, this patchset should
> > > be split up. Or if, f.e. given the simple nature of the patches,
> > > an exception applies in this case. Or something else.
> > > 
> > > I have no fixed opinion on this.
> > > But I feel that the question should be asked.
> > > 
> > > Link: https://kernel.org/doc/html/v6.1/process/maintainer-netdev.html
> > > 
> > > ...
> > 
> > I now realise this series is for can.
> > Which I assume means the guidance above doesn't apply.
> > 
> > Sorry for the noise.
> 
> That's still a good point, because sooner or later Uwe will probably
> also convert the platform drivers to Driver/Network/Ethernet.

...in driver/net/ethernet.

(damnyouautocorrect)

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2023-05-16  8:57 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-12 21:27 [PATCH net-next 00/19] can: Convert to platform remove callback returning void Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 01/19] can: at91_can: " Uwe Kleine-König
2023-05-15  6:48   ` Claudiu.Beznea
2023-05-12 21:27 ` [PATCH 02/19] can: bxcan: " Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 03/19] can: c_can: " Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 04/19] can: cc770_isa: " Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 05/19] can: cc770_platform: " Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 06/19] can: ctucanfd: " Uwe Kleine-König
2023-05-14 13:50   ` Pavel Pisa
2023-05-12 21:27 ` [PATCH 07/19] can: flexcan: " Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 08/19] can: grcan: " Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 09/19] can: ifi_canfd: " Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 10/19] can: janz-ican3: " Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 11/19] can: m_can: " Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 12/19] can: mscan/mpc5xxx_can.c -- " Uwe Kleine-König
2023-05-12 21:37   ` Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 13/19] can: rcar: " Uwe Kleine-König
2023-05-15  7:53   ` Geert Uytterhoeven
2023-05-12 21:27 ` [PATCH 14/19] can: sja1000_isa: " Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 15/19] can: sja1000_platform: " Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 16/19] can: softing: " Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 17/19] can: sun4i_can: " Uwe Kleine-König
2023-05-13  6:36   ` Jernej Škrabec
2023-05-14 17:05   ` Gerhard Bertelsmann
2023-05-12 21:27 ` [PATCH 18/19] can: ti_hecc: " Uwe Kleine-König
2023-05-12 21:27 ` [PATCH 19/19] can: xilinx: " Uwe Kleine-König
2023-05-16  7:31 ` [PATCH net-next 00/19] can: " Simon Horman
2023-05-16  8:45   ` Simon Horman
2023-05-16  8:54     ` Marc Kleine-Budde
2023-05-16  8:56       ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).