* [PATCH 00/21] EDAC: Convert to platform remove callback returning void
@ 2023-10-04 13:12 Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 01/21] EDAC/altera: " Uwe Kleine-König
` (23 more replies)
0 siblings, 24 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Dinh Nguyen, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-edac, kernel, Jan Luebbe, Stefan Schaeckeler, Joel Stanley,
Andrew Jeffery, linux-arm-kernel, linux-aspeed,
Shravan Kumar Ramani, Lei Wang, Andre Przywara,
Johannes Thumshirn, Avi Fishman, Tomer Maimon, Tali Perry,
Patrick Venture, Nancy Yuen, Benjamin Fair, Marvin Lin,
Stanley Chu, openbmc, Ralf Baechle, linux-mips,
Manivannan Sadhasivam, Andy Gross, Bjorn Andersson, Konrad Dybcio,
linux-arm-msm, Michal Simek, Tero Kristo, Khuong Dinh,
Shubhrajyoti Datta, Sai Krishna Potthuri
Hello,
this series converts all platform drivers below drivers/edac to use
.remove_new(). The motivation is to get rid of an integer return code
that is (mostly) ignored by the platform driver core and error prone on
the driver side. However none of the edac drivers suffered from the easy
to make bug, so all drivers are converted in a trivial way.
See commit 5c5a7680e67b ("platform: Provide a remove callback that
returns no value") for an extended explanation and the eventual goal.
The patch for npcm was already sent back in June
(https://lore.kernel.org/linux-edac/20230628071354.665300-1-u.kleine-koenig@pengutronix.de)
but didn't result in enthusiastic review comments and it wasn't picked
up.
There are no interdependencies between the patches. As there are still
quite a few drivers to convert, I'm happy about every patch that makes
it in. So even if there is a merge conflict with one patch until you
apply, please apply the remainder of this series anyhow. I'll come back
to the part that you (maybe) skipped at a later point.
Best regards
Uwe
Uwe Kleine-König (21):
EDAC/altera: Convert to platform remove callback returning void
EDAC/armada_xp: Convert to platform remove callback returning void
EDAC/aspeed: Convert to platform remove callback returning void
EDAC/bluefield: Convert to platform remove callback returning void
EDAC/cell: Convert to platform remove callback returning void
EDAC/cpc925: Convert to platform remove callback returning void
EDAC/dmc520: Convert to platform remove callback returning void
EDAC/highbank_l2: Convert to platform remove callback returning void
EDAC/highbank_mc: Convert to platform remove callback returning void
EDAC/mpc85xx: Convert to platform remove callback returning void
EDAC/npcm: Convert to platform remove callback returning void
EDAC/octeon-l2c: Convert to platform remove callback returning void
EDAC/octeon-lmc: Convert to platform remove callback returning void
EDAC/octeon-pc: Convert to platform remove callback returning void
EDAC/octeon-pci: Convert to platform remove callback returning void
EDAC/ppc4xx: Convert to platform remove callback returning void
EDAC/qcom: Convert to platform remove callback returning void
EDAC/synopsys: Convert to platform remove callback returning void
EDAC/ti: Convert to platform remove callback returning void
EDAC/xgene: Convert to platform remove callback returning void
EDAC/zynqmp: Convert to platform remove callback returning void
drivers/edac/altera_edac.c | 12 ++++--------
drivers/edac/armada_xp_edac.c | 12 ++++--------
drivers/edac/aspeed_edac.c | 6 ++----
drivers/edac/bluefield_edac.c | 6 ++----
drivers/edac/cell_edac.c | 5 ++---
drivers/edac/cpc925_edac.c | 6 ++----
drivers/edac/dmc520_edac.c | 6 ++----
drivers/edac/highbank_l2_edac.c | 5 ++---
drivers/edac/highbank_mc_edac.c | 5 ++---
drivers/edac/mpc85xx_edac.c | 11 ++++-------
drivers/edac/npcm_edac.c | 6 ++----
drivers/edac/octeon_edac-l2c.c | 6 ++----
drivers/edac/octeon_edac-lmc.c | 5 ++---
drivers/edac/octeon_edac-pc.c | 5 ++---
drivers/edac/octeon_edac-pci.c | 6 ++----
drivers/edac/ppc4xx_edac.c | 7 ++-----
drivers/edac/qcom_edac.c | 6 ++----
drivers/edac/synopsys_edac.c | 6 ++----
drivers/edac/ti_edac.c | 6 ++----
drivers/edac/xgene_edac.c | 6 ++----
drivers/edac/zynqmp_edac.c | 6 ++----
21 files changed, 48 insertions(+), 91 deletions(-)
base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
--
2.40.1
^ permalink raw reply [flat|nested] 33+ messages in thread
* [PATCH 01/21] EDAC/altera: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 02/21] EDAC/armada_xp: " Uwe Kleine-König
` (22 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Dinh Nguyen, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-edac, 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() will be 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/edac/altera_edac.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 8b31cd54bdb6..09169f3726f4 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -459,15 +459,13 @@ static int altr_sdram_probe(struct platform_device *pdev)
return res;
}
-static int altr_sdram_remove(struct platform_device *pdev)
+static void altr_sdram_remove(struct platform_device *pdev)
{
struct mem_ctl_info *mci = platform_get_drvdata(pdev);
edac_mc_del_mc(&pdev->dev);
edac_mc_free(mci);
platform_set_drvdata(pdev, NULL);
-
- return 0;
}
/*
@@ -489,7 +487,7 @@ static const struct dev_pm_ops altr_sdram_pm_ops = {
static struct platform_driver altr_sdram_edac_driver = {
.probe = altr_sdram_probe,
- .remove = altr_sdram_remove,
+ .remove_new = altr_sdram_remove,
.driver = {
.name = "altr_sdram_edac",
#ifdef CONFIG_PM
@@ -812,7 +810,7 @@ static int altr_edac_device_probe(struct platform_device *pdev)
return res;
}
-static int altr_edac_device_remove(struct platform_device *pdev)
+static void altr_edac_device_remove(struct platform_device *pdev)
{
struct edac_device_ctl_info *dci = platform_get_drvdata(pdev);
struct altr_edac_device_dev *drvdata = dci->pvt_info;
@@ -820,13 +818,11 @@ static int altr_edac_device_remove(struct platform_device *pdev)
debugfs_remove_recursive(drvdata->debugfs_dir);
edac_device_del_device(&pdev->dev);
edac_device_free_ctl_info(dci);
-
- return 0;
}
static struct platform_driver altr_edac_device_driver = {
.probe = altr_edac_device_probe,
- .remove = altr_edac_device_remove,
+ .remove_new = altr_edac_device_remove,
.driver = {
.name = "altr_edac_device",
.of_match_table = altr_edac_device_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 02/21] EDAC/armada_xp: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 01/21] EDAC/altera: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 03/21] EDAC/aspeed: " Uwe Kleine-König
` (21 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Jan Luebbe, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-edac, 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() will be 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/edac/armada_xp_edac.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/edac/armada_xp_edac.c b/drivers/edac/armada_xp_edac.c
index c4bd2fb9c46b..5bcd34f23baf 100644
--- a/drivers/edac/armada_xp_edac.c
+++ b/drivers/edac/armada_xp_edac.c
@@ -351,20 +351,18 @@ static int axp_mc_probe(struct platform_device *pdev)
return 0;
}
-static int axp_mc_remove(struct platform_device *pdev)
+static void axp_mc_remove(struct platform_device *pdev)
{
struct mem_ctl_info *mci = platform_get_drvdata(pdev);
edac_mc_del_mc(&pdev->dev);
edac_mc_free(mci);
platform_set_drvdata(pdev, NULL);
-
- return 0;
}
static struct platform_driver axp_mc_driver = {
.probe = axp_mc_probe,
- .remove = axp_mc_remove,
+ .remove_new = axp_mc_remove,
.driver = {
.name = "armada_xp_mc_edac",
.of_match_table = of_match_ptr(axp_mc_of_match),
@@ -564,7 +562,7 @@ static int aurora_l2_probe(struct platform_device *pdev)
return 0;
}
-static int aurora_l2_remove(struct platform_device *pdev)
+static void aurora_l2_remove(struct platform_device *pdev)
{
struct edac_device_ctl_info *dci = platform_get_drvdata(pdev);
#ifdef CONFIG_EDAC_DEBUG
@@ -575,13 +573,11 @@ static int aurora_l2_remove(struct platform_device *pdev)
edac_device_del_device(&pdev->dev);
edac_device_free_ctl_info(dci);
platform_set_drvdata(pdev, NULL);
-
- return 0;
}
static struct platform_driver aurora_l2_driver = {
.probe = aurora_l2_probe,
- .remove = aurora_l2_remove,
+ .remove_new = aurora_l2_remove,
.driver = {
.name = "aurora_l2_edac",
.of_match_table = of_match_ptr(aurora_l2_of_match),
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 03/21] EDAC/aspeed: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 01/21] EDAC/altera: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 02/21] EDAC/armada_xp: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 04/21] EDAC/bluefield: " Uwe Kleine-König
` (20 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Stefan Schaeckeler, James Morse, Mauro Carvalho Chehab,
Robert Richter, Joel Stanley, Andrew Jeffery, linux-edac,
linux-arm-kernel, linux-aspeed, 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() will be 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/edac/aspeed_edac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c
index 6bd5f8815919..157a480eb761 100644
--- a/drivers/edac/aspeed_edac.c
+++ b/drivers/edac/aspeed_edac.c
@@ -357,7 +357,7 @@ static int aspeed_probe(struct platform_device *pdev)
}
-static int aspeed_remove(struct platform_device *pdev)
+static void aspeed_remove(struct platform_device *pdev)
{
struct mem_ctl_info *mci;
@@ -369,8 +369,6 @@ static int aspeed_remove(struct platform_device *pdev)
mci = edac_mc_del_mc(&pdev->dev);
if (mci)
edac_mc_free(mci);
-
- return 0;
}
@@ -389,7 +387,7 @@ static struct platform_driver aspeed_driver = {
.of_match_table = aspeed_of_match
},
.probe = aspeed_probe,
- .remove = aspeed_remove
+ .remove_new = aspeed_remove
};
module_platform_driver(aspeed_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 04/21] EDAC/bluefield: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (2 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 03/21] EDAC/aspeed: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 05/21] EDAC/cell: " Uwe Kleine-König
` (19 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Shravan Kumar Ramani, James Morse, Mauro Carvalho Chehab,
Robert Richter, linux-edac, 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() will be 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/edac/bluefield_edac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/edac/bluefield_edac.c b/drivers/edac/bluefield_edac.c
index e4736eb37bfb..5b3164560648 100644
--- a/drivers/edac/bluefield_edac.c
+++ b/drivers/edac/bluefield_edac.c
@@ -323,14 +323,12 @@ static int bluefield_edac_mc_probe(struct platform_device *pdev)
}
-static int bluefield_edac_mc_remove(struct platform_device *pdev)
+static void bluefield_edac_mc_remove(struct platform_device *pdev)
{
struct mem_ctl_info *mci = platform_get_drvdata(pdev);
edac_mc_del_mc(&pdev->dev);
edac_mc_free(mci);
-
- return 0;
}
static const struct acpi_device_id bluefield_mc_acpi_ids[] = {
@@ -346,7 +344,7 @@ static struct platform_driver bluefield_edac_mc_driver = {
.acpi_match_table = bluefield_mc_acpi_ids,
},
.probe = bluefield_edac_mc_probe,
- .remove = bluefield_edac_mc_remove,
+ .remove_new = bluefield_edac_mc_remove,
};
module_platform_driver(bluefield_edac_mc_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 05/21] EDAC/cell: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (3 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 04/21] EDAC/bluefield: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 06/21] EDAC/cpc925: " Uwe Kleine-König
` (18 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: James Morse, Mauro Carvalho Chehab, Robert Richter, linux-edac,
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() will be 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/edac/cell_edac.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/edac/cell_edac.c b/drivers/edac/cell_edac.c
index bc1f3416400e..2000f66fbf5c 100644
--- a/drivers/edac/cell_edac.c
+++ b/drivers/edac/cell_edac.c
@@ -234,12 +234,11 @@ static int cell_edac_probe(struct platform_device *pdev)
return 0;
}
-static int cell_edac_remove(struct platform_device *pdev)
+static void cell_edac_remove(struct platform_device *pdev)
{
struct mem_ctl_info *mci = edac_mc_del_mc(&pdev->dev);
if (mci)
edac_mc_free(mci);
- return 0;
}
static struct platform_driver cell_edac_driver = {
@@ -247,7 +246,7 @@ static struct platform_driver cell_edac_driver = {
.name = "cbe-mic",
},
.probe = cell_edac_probe,
- .remove = cell_edac_remove,
+ .remove_new = cell_edac_remove,
};
static int __init cell_edac_init(void)
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 06/21] EDAC/cpc925: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (4 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 05/21] EDAC/cell: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 07/21] EDAC/dmc520: " Uwe Kleine-König
` (17 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: James Morse, Mauro Carvalho Chehab, Robert Richter, linux-edac,
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() will be 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/edac/cpc925_edac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c
index 9797e6d60dde..5075dc7526e3 100644
--- a/drivers/edac/cpc925_edac.c
+++ b/drivers/edac/cpc925_edac.c
@@ -1010,7 +1010,7 @@ static int cpc925_probe(struct platform_device *pdev)
return res;
}
-static int cpc925_remove(struct platform_device *pdev)
+static void cpc925_remove(struct platform_device *pdev)
{
struct mem_ctl_info *mci = platform_get_drvdata(pdev);
@@ -1023,13 +1023,11 @@ static int cpc925_remove(struct platform_device *pdev)
edac_mc_del_mc(&pdev->dev);
edac_mc_free(mci);
-
- return 0;
}
static struct platform_driver cpc925_edac_driver = {
.probe = cpc925_probe,
- .remove = cpc925_remove,
+ .remove_new = cpc925_remove,
.driver = {
.name = "cpc925_edac",
}
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 07/21] EDAC/dmc520: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (5 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 06/21] EDAC/cpc925: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 08/21] EDAC/highbank_l2: " Uwe Kleine-König
` (16 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Lei Wang, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-edac, 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() will be 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/edac/dmc520_edac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/edac/dmc520_edac.c b/drivers/edac/dmc520_edac.c
index 1fa5ca57e9ec..4e30b989a1a4 100644
--- a/drivers/edac/dmc520_edac.c
+++ b/drivers/edac/dmc520_edac.c
@@ -602,7 +602,7 @@ static int dmc520_edac_probe(struct platform_device *pdev)
return ret;
}
-static int dmc520_edac_remove(struct platform_device *pdev)
+static void dmc520_edac_remove(struct platform_device *pdev)
{
u32 reg_val, idx, irq_mask_all = 0;
struct mem_ctl_info *mci;
@@ -626,8 +626,6 @@ static int dmc520_edac_remove(struct platform_device *pdev)
edac_mc_del_mc(&pdev->dev);
edac_mc_free(mci);
-
- return 0;
}
static const struct of_device_id dmc520_edac_driver_id[] = {
@@ -644,7 +642,7 @@ static struct platform_driver dmc520_edac_driver = {
},
.probe = dmc520_edac_probe,
- .remove = dmc520_edac_remove
+ .remove_new = dmc520_edac_remove
};
module_platform_driver(dmc520_edac_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 08/21] EDAC/highbank_l2: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (6 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 07/21] EDAC/dmc520: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-11-20 17:45 ` Andre Przywara
2023-10-04 13:12 ` [PATCH 09/21] EDAC/highbank_mc: " Uwe Kleine-König
` (15 subsequent siblings)
23 siblings, 1 reply; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Andre Przywara, James Morse, Mauro Carvalho Chehab,
Robert Richter, linux-edac, 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() will be 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/edac/highbank_l2_edac.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/edac/highbank_l2_edac.c b/drivers/edac/highbank_l2_edac.c
index 140d4431bd0d..5646c049a934 100644
--- a/drivers/edac/highbank_l2_edac.c
+++ b/drivers/edac/highbank_l2_edac.c
@@ -118,18 +118,17 @@ static int highbank_l2_err_probe(struct platform_device *pdev)
return res;
}
-static int highbank_l2_err_remove(struct platform_device *pdev)
+static void highbank_l2_err_remove(struct platform_device *pdev)
{
struct edac_device_ctl_info *dci = platform_get_drvdata(pdev);
edac_device_del_device(&pdev->dev);
edac_device_free_ctl_info(dci);
- return 0;
}
static struct platform_driver highbank_l2_edac_driver = {
.probe = highbank_l2_err_probe,
- .remove = highbank_l2_err_remove,
+ .remove_new = highbank_l2_err_remove,
.driver = {
.name = "hb_l2_edac",
.of_match_table = hb_l2_err_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 09/21] EDAC/highbank_mc: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (7 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 08/21] EDAC/highbank_l2: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-11-20 17:45 ` Andre Przywara
2023-10-04 13:12 ` [PATCH 10/21] EDAC/mpc85xx: " Uwe Kleine-König
` (14 subsequent siblings)
23 siblings, 1 reply; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Andre Przywara, James Morse, Mauro Carvalho Chehab,
Robert Richter, linux-edac, 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() will be 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/edac/highbank_mc_edac.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/edac/highbank_mc_edac.c b/drivers/edac/highbank_mc_edac.c
index a0c04a7f95e9..1c5b888ab11d 100644
--- a/drivers/edac/highbank_mc_edac.c
+++ b/drivers/edac/highbank_mc_edac.c
@@ -251,18 +251,17 @@ static int highbank_mc_probe(struct platform_device *pdev)
return res;
}
-static int highbank_mc_remove(struct platform_device *pdev)
+static void highbank_mc_remove(struct platform_device *pdev)
{
struct mem_ctl_info *mci = platform_get_drvdata(pdev);
edac_mc_del_mc(&pdev->dev);
edac_mc_free(mci);
- return 0;
}
static struct platform_driver highbank_mc_edac_driver = {
.probe = highbank_mc_probe,
- .remove = highbank_mc_remove,
+ .remove_new = highbank_mc_remove,
.driver = {
.name = "hb_mc_edac",
.of_match_table = hb_ddr_ctrl_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 10/21] EDAC/mpc85xx: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (8 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 09/21] EDAC/highbank_mc: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 11/21] EDAC/npcm: " Uwe Kleine-König
` (13 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Johannes Thumshirn, James Morse, Mauro Carvalho Chehab,
Robert Richter, linux-edac, 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() will be 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/edac/mpc85xx_edac.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index 2b5703e5066e..e0d702cef66f 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -300,7 +300,7 @@ static int mpc85xx_pci_err_probe(struct platform_device *op)
return res;
}
-static int mpc85xx_pci_err_remove(struct platform_device *op)
+static void mpc85xx_pci_err_remove(struct platform_device *op)
{
struct edac_pci_ctl_info *pci = dev_get_drvdata(&op->dev);
struct mpc85xx_pci_pdata *pdata = pci->pvt_info;
@@ -312,8 +312,6 @@ static int mpc85xx_pci_err_remove(struct platform_device *op)
edac_pci_del_device(&op->dev);
edac_pci_free_ctl_info(pci);
-
- return 0;
}
static const struct platform_device_id mpc85xx_pci_err_match[] = {
@@ -325,7 +323,7 @@ static const struct platform_device_id mpc85xx_pci_err_match[] = {
static struct platform_driver mpc85xx_pci_err_driver = {
.probe = mpc85xx_pci_err_probe,
- .remove = mpc85xx_pci_err_remove,
+ .remove_new = mpc85xx_pci_err_remove,
.id_table = mpc85xx_pci_err_match,
.driver = {
.name = "mpc85xx_pci_err",
@@ -591,7 +589,7 @@ static int mpc85xx_l2_err_probe(struct platform_device *op)
return res;
}
-static int mpc85xx_l2_err_remove(struct platform_device *op)
+static void mpc85xx_l2_err_remove(struct platform_device *op)
{
struct edac_device_ctl_info *edac_dev = dev_get_drvdata(&op->dev);
struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info;
@@ -606,7 +604,6 @@ static int mpc85xx_l2_err_remove(struct platform_device *op)
out_be32(pdata->l2_vbase + MPC85XX_L2_ERRDIS, orig_l2_err_disable);
edac_device_del_device(&op->dev);
edac_device_free_ctl_info(edac_dev);
- return 0;
}
static const struct of_device_id mpc85xx_l2_err_of_match[] = {
@@ -630,7 +627,7 @@ MODULE_DEVICE_TABLE(of, mpc85xx_l2_err_of_match);
static struct platform_driver mpc85xx_l2_err_driver = {
.probe = mpc85xx_l2_err_probe,
- .remove = mpc85xx_l2_err_remove,
+ .remove_new = mpc85xx_l2_err_remove,
.driver = {
.name = "mpc85xx_l2_err",
.of_match_table = mpc85xx_l2_err_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 11/21] EDAC/npcm: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (9 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 10/21] EDAC/mpc85xx: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 12/21] EDAC/octeon-l2c: " Uwe Kleine-König
` (12 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
Nancy Yuen, Benjamin Fair, Marvin Lin, Stanley Chu, James Morse,
Mauro Carvalho Chehab, Robert Richter, openbmc, linux-edac,
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() will be 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/edac/npcm_edac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/edac/npcm_edac.c b/drivers/edac/npcm_edac.c
index 6d15c1550263..2e2133b784e9 100644
--- a/drivers/edac/npcm_edac.c
+++ b/drivers/edac/npcm_edac.c
@@ -410,7 +410,7 @@ static int edac_probe(struct platform_device *pdev)
return rc;
}
-static int edac_remove(struct platform_device *pdev)
+static void edac_remove(struct platform_device *pdev)
{
struct mem_ctl_info *mci = platform_get_drvdata(pdev);
struct priv_data *priv = mci->pvt_info;
@@ -426,8 +426,6 @@ static int edac_remove(struct platform_device *pdev)
regmap_write(npcm_regmap, pdata->ctl_int_mask_master,
pdata->int_mask_master_global_mask);
regmap_update_bits(npcm_regmap, pdata->ctl_ecc_en, pdata->ecc_en_mask, 0);
-
- return 0;
}
static const struct npcm_platform_data npcm750_edac = {
@@ -533,7 +531,7 @@ static struct platform_driver npcm_edac_driver = {
.of_match_table = npcm_edac_of_match,
},
.probe = edac_probe,
- .remove = edac_remove,
+ .remove_new = edac_remove,
};
module_platform_driver(npcm_edac_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 12/21] EDAC/octeon-l2c: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (10 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 11/21] EDAC/npcm: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-10 14:03 ` Philippe Mathieu-Daudé
2023-10-04 13:12 ` [PATCH 13/21] EDAC/octeon-lmc: " Uwe Kleine-König
` (11 subsequent siblings)
23 siblings, 1 reply; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Ralf Baechle, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-edac, linux-mips, 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() will be 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/edac/octeon_edac-l2c.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/edac/octeon_edac-l2c.c b/drivers/edac/octeon_edac-l2c.c
index c33059e9b0be..4015eb9af6fe 100644
--- a/drivers/edac/octeon_edac-l2c.c
+++ b/drivers/edac/octeon_edac-l2c.c
@@ -184,19 +184,17 @@ static int octeon_l2c_probe(struct platform_device *pdev)
return -ENXIO;
}
-static int octeon_l2c_remove(struct platform_device *pdev)
+static void octeon_l2c_remove(struct platform_device *pdev)
{
struct edac_device_ctl_info *l2c = platform_get_drvdata(pdev);
edac_device_del_device(&pdev->dev);
edac_device_free_ctl_info(l2c);
-
- return 0;
}
static struct platform_driver octeon_l2c_driver = {
.probe = octeon_l2c_probe,
- .remove = octeon_l2c_remove,
+ .remove_new = octeon_l2c_remove,
.driver = {
.name = "octeon_l2c_edac",
}
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 13/21] EDAC/octeon-lmc: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (11 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 12/21] EDAC/octeon-l2c: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-10 14:02 ` Philippe Mathieu-Daudé
2023-10-04 13:12 ` [PATCH 14/21] EDAC/octeon-pc: " Uwe Kleine-König
` (10 subsequent siblings)
23 siblings, 1 reply; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Ralf Baechle, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-edac, linux-mips, 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() will be 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/edac/octeon_edac-lmc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/edac/octeon_edac-lmc.c b/drivers/edac/octeon_edac-lmc.c
index aeb222ca3ed1..18615cbcd9ea 100644
--- a/drivers/edac/octeon_edac-lmc.c
+++ b/drivers/edac/octeon_edac-lmc.c
@@ -302,18 +302,17 @@ static int octeon_lmc_edac_probe(struct platform_device *pdev)
return 0;
}
-static int octeon_lmc_edac_remove(struct platform_device *pdev)
+static void octeon_lmc_edac_remove(struct platform_device *pdev)
{
struct mem_ctl_info *mci = platform_get_drvdata(pdev);
edac_mc_del_mc(&pdev->dev);
edac_mc_free(mci);
- return 0;
}
static struct platform_driver octeon_lmc_edac_driver = {
.probe = octeon_lmc_edac_probe,
- .remove = octeon_lmc_edac_remove,
+ .remove_new = octeon_lmc_edac_remove,
.driver = {
.name = "octeon_lmc_edac",
}
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 14/21] EDAC/octeon-pc: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (12 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 13/21] EDAC/octeon-lmc: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-10 14:03 ` Philippe Mathieu-Daudé
2023-10-04 13:12 ` [PATCH 15/21] EDAC/octeon-pci: " Uwe Kleine-König
` (9 subsequent siblings)
23 siblings, 1 reply; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Ralf Baechle, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-edac, linux-mips, 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() will be 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/edac/octeon_edac-pc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/edac/octeon_edac-pc.c b/drivers/edac/octeon_edac-pc.c
index 754eced59c32..ea8a8e337b1e 100644
--- a/drivers/edac/octeon_edac-pc.c
+++ b/drivers/edac/octeon_edac-pc.c
@@ -119,19 +119,18 @@ static int co_cache_error_probe(struct platform_device *pdev)
return -ENXIO;
}
-static int co_cache_error_remove(struct platform_device *pdev)
+static void co_cache_error_remove(struct platform_device *pdev)
{
struct co_cache_error *p = platform_get_drvdata(pdev);
unregister_co_cache_error_notifier(&p->notifier);
edac_device_del_device(&pdev->dev);
edac_device_free_ctl_info(p->ed);
- return 0;
}
static struct platform_driver co_cache_error_driver = {
.probe = co_cache_error_probe,
- .remove = co_cache_error_remove,
+ .remove_new = co_cache_error_remove,
.driver = {
.name = "octeon_pc_edac",
}
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 15/21] EDAC/octeon-pci: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (13 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 14/21] EDAC/octeon-pc: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-10 14:03 ` Philippe Mathieu-Daudé
2023-10-04 13:12 ` [PATCH 16/21] EDAC/ppc4xx: " Uwe Kleine-König
` (8 subsequent siblings)
23 siblings, 1 reply; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Ralf Baechle, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-edac, linux-mips, 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() will be 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/edac/octeon_edac-pci.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/edac/octeon_edac-pci.c b/drivers/edac/octeon_edac-pci.c
index 28b238eecefc..108ad9493cfb 100644
--- a/drivers/edac/octeon_edac-pci.c
+++ b/drivers/edac/octeon_edac-pci.c
@@ -87,19 +87,17 @@ static int octeon_pci_probe(struct platform_device *pdev)
return res;
}
-static int octeon_pci_remove(struct platform_device *pdev)
+static void octeon_pci_remove(struct platform_device *pdev)
{
struct edac_pci_ctl_info *pci = platform_get_drvdata(pdev);
edac_pci_del_device(&pdev->dev);
edac_pci_free_ctl_info(pci);
-
- return 0;
}
static struct platform_driver octeon_pci_driver = {
.probe = octeon_pci_probe,
- .remove = octeon_pci_remove,
+ .remove_new = octeon_pci_remove,
.driver = {
.name = "octeon_pci_edac",
}
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 16/21] EDAC/ppc4xx: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (14 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 15/21] EDAC/octeon-pci: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 17/21] EDAC/qcom: " Uwe Kleine-König
` (7 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: James Morse, Mauro Carvalho Chehab, Robert Richter, linux-edac,
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() will be 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/edac/ppc4xx_edac.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c
index 046969b4e82e..1eea3341a916 100644
--- a/drivers/edac/ppc4xx_edac.c
+++ b/drivers/edac/ppc4xx_edac.c
@@ -1329,8 +1329,7 @@ static int ppc4xx_edac_probe(struct platform_device *op)
*
* Unconditionally returns 0.
*/
-static int
-ppc4xx_edac_remove(struct platform_device *op)
+static void ppc4xx_edac_remove(struct platform_device *op)
{
struct mem_ctl_info *mci = dev_get_drvdata(&op->dev);
struct ppc4xx_edac_pdata *pdata = mci->pvt_info;
@@ -1344,8 +1343,6 @@ ppc4xx_edac_remove(struct platform_device *op)
edac_mc_del_mc(mci->pdev);
edac_mc_free(mci);
-
- return 0;
}
/**
@@ -1379,7 +1376,7 @@ ppc4xx_edac_opstate_init(void)
static struct platform_driver ppc4xx_edac_driver = {
.probe = ppc4xx_edac_probe,
- .remove = ppc4xx_edac_remove,
+ .remove_new = ppc4xx_edac_remove,
.driver = {
.name = PPC4XX_EDAC_MODULE_NAME,
.of_match_table = ppc4xx_edac_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 17/21] EDAC/qcom: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (15 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 16/21] EDAC/ppc4xx: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 18/21] EDAC/synopsys: " Uwe Kleine-König
` (6 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Manivannan Sadhasivam, Andy Gross, Bjorn Andersson, Konrad Dybcio,
James Morse, Mauro Carvalho Chehab, Robert Richter, linux-arm-msm,
linux-edac, 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() will be 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/edac/qcom_edac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/edac/qcom_edac.c b/drivers/edac/qcom_edac.c
index b2db545c6810..5539917c01dd 100644
--- a/drivers/edac/qcom_edac.c
+++ b/drivers/edac/qcom_edac.c
@@ -390,14 +390,12 @@ static int qcom_llcc_edac_probe(struct platform_device *pdev)
return rc;
}
-static int qcom_llcc_edac_remove(struct platform_device *pdev)
+static void qcom_llcc_edac_remove(struct platform_device *pdev)
{
struct edac_device_ctl_info *edev_ctl = dev_get_drvdata(&pdev->dev);
edac_device_del_device(edev_ctl->dev);
edac_device_free_ctl_info(edev_ctl);
-
- return 0;
}
static const struct platform_device_id qcom_llcc_edac_id_table[] = {
@@ -408,7 +406,7 @@ MODULE_DEVICE_TABLE(platform, qcom_llcc_edac_id_table);
static struct platform_driver qcom_llcc_edac_driver = {
.probe = qcom_llcc_edac_probe,
- .remove = qcom_llcc_edac_remove,
+ .remove_new = qcom_llcc_edac_remove,
.driver = {
.name = "qcom_llcc_edac",
},
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 18/21] EDAC/synopsys: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (16 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 17/21] EDAC/qcom: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 19/21] EDAC/ti: " Uwe Kleine-König
` (5 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Michal Simek, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-arm-kernel, linux-edac, 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() will be 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/edac/synopsys_edac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c
index c4fc64cbecd0..709babce43ba 100644
--- a/drivers/edac/synopsys_edac.c
+++ b/drivers/edac/synopsys_edac.c
@@ -1410,7 +1410,7 @@ static int mc_probe(struct platform_device *pdev)
*
* Return: Unconditionally 0
*/
-static int mc_remove(struct platform_device *pdev)
+static void mc_remove(struct platform_device *pdev)
{
struct mem_ctl_info *mci = platform_get_drvdata(pdev);
struct synps_edac_priv *priv = mci->pvt_info;
@@ -1425,8 +1425,6 @@ static int mc_remove(struct platform_device *pdev)
edac_mc_del_mc(&pdev->dev);
edac_mc_free(mci);
-
- return 0;
}
static struct platform_driver synps_edac_mc_driver = {
@@ -1435,7 +1433,7 @@ static struct platform_driver synps_edac_mc_driver = {
.of_match_table = synps_edac_match,
},
.probe = mc_probe,
- .remove = mc_remove,
+ .remove_new = mc_remove,
};
module_platform_driver(synps_edac_mc_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 19/21] EDAC/ti: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (17 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 18/21] EDAC/synopsys: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 20/21] EDAC/xgene: " Uwe Kleine-König
` (4 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Tero Kristo, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-edac, 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() will be 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/edac/ti_edac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/edac/ti_edac.c b/drivers/edac/ti_edac.c
index 6971ded598de..29723c9592f7 100644
--- a/drivers/edac/ti_edac.c
+++ b/drivers/edac/ti_edac.c
@@ -312,19 +312,17 @@ static int ti_edac_probe(struct platform_device *pdev)
return ret;
}
-static int ti_edac_remove(struct platform_device *pdev)
+static void ti_edac_remove(struct platform_device *pdev)
{
struct mem_ctl_info *mci = platform_get_drvdata(pdev);
edac_mc_del_mc(&pdev->dev);
edac_mc_free(mci);
-
- return 0;
}
static struct platform_driver ti_edac_driver = {
.probe = ti_edac_probe,
- .remove = ti_edac_remove,
+ .remove_new = ti_edac_remove,
.driver = {
.name = EDAC_MOD_NAME,
.of_match_table = ti_edac_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 20/21] EDAC/xgene: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (18 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 19/21] EDAC/ti: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 21/21] EDAC/zynqmp: " Uwe Kleine-König
` (3 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Khuong Dinh, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-edac, 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() will be 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/edac/xgene_edac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c
index c52b9dd9154c..1b50f8160013 100644
--- a/drivers/edac/xgene_edac.c
+++ b/drivers/edac/xgene_edac.c
@@ -1960,7 +1960,7 @@ static int xgene_edac_probe(struct platform_device *pdev)
return rc;
}
-static int xgene_edac_remove(struct platform_device *pdev)
+static void xgene_edac_remove(struct platform_device *pdev)
{
struct xgene_edac *edac = dev_get_drvdata(&pdev->dev);
struct xgene_edac_mc_ctx *mcu;
@@ -1981,8 +1981,6 @@ static int xgene_edac_remove(struct platform_device *pdev)
list_for_each_entry_safe(node, temp_node, &edac->socs, next)
xgene_edac_soc_remove(node);
-
- return 0;
}
static const struct of_device_id xgene_edac_of_match[] = {
@@ -1993,7 +1991,7 @@ MODULE_DEVICE_TABLE(of, xgene_edac_of_match);
static struct platform_driver xgene_edac_driver = {
.probe = xgene_edac_probe,
- .remove = xgene_edac_remove,
+ .remove_new = xgene_edac_remove,
.driver = {
.name = "xgene-edac",
.of_match_table = xgene_edac_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 21/21] EDAC/zynqmp: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (19 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 20/21] EDAC/xgene: " Uwe Kleine-König
@ 2023-10-04 13:12 ` Uwe Kleine-König
2023-10-04 13:14 ` Michal Simek
2023-10-13 10:04 ` [PATCH 22/21] EDAC/fsl_ddr: " Uwe Kleine-König
` (2 subsequent siblings)
23 siblings, 1 reply; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-04 13:12 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Shubhrajyoti Datta, Sai Krishna Potthuri, James Morse,
Mauro Carvalho Chehab, Robert Richter, Michal Simek, linux-edac,
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() will be 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/edac/zynqmp_edac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/edac/zynqmp_edac.c b/drivers/edac/zynqmp_edac.c
index ac7d1e0b324c..2d9a5cfd8931 100644
--- a/drivers/edac/zynqmp_edac.c
+++ b/drivers/edac/zynqmp_edac.c
@@ -426,7 +426,7 @@ static int edac_probe(struct platform_device *pdev)
return ret;
}
-static int edac_remove(struct platform_device *pdev)
+static void edac_remove(struct platform_device *pdev)
{
struct edac_device_ctl_info *dci = platform_get_drvdata(pdev);
struct edac_priv *priv = dci->pvt_info;
@@ -440,8 +440,6 @@ static int edac_remove(struct platform_device *pdev)
edac_device_del_device(&pdev->dev);
edac_device_free_ctl_info(dci);
-
- return 0;
}
static const struct of_device_id zynqmp_ocm_edac_match[] = {
@@ -457,7 +455,7 @@ static struct platform_driver zynqmp_ocm_edac_driver = {
.of_match_table = zynqmp_ocm_edac_match,
},
.probe = edac_probe,
- .remove = edac_remove,
+ .remove_new = edac_remove,
};
module_platform_driver(zynqmp_ocm_edac_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* Re: [PATCH 21/21] EDAC/zynqmp: Convert to platform remove callback returning void
2023-10-04 13:12 ` [PATCH 21/21] EDAC/zynqmp: " Uwe Kleine-König
@ 2023-10-04 13:14 ` Michal Simek
0 siblings, 0 replies; 33+ messages in thread
From: Michal Simek @ 2023-10-04 13:14 UTC (permalink / raw)
To: Uwe Kleine-König, Borislav Petkov, Tony Luck
Cc: Shubhrajyoti Datta, Sai Krishna Potthuri, James Morse,
Mauro Carvalho Chehab, Robert Richter, linux-edac,
linux-arm-kernel, kernel
On 10/4/23 15: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() will be 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/edac/zynqmp_edac.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/edac/zynqmp_edac.c b/drivers/edac/zynqmp_edac.c
> index ac7d1e0b324c..2d9a5cfd8931 100644
> --- a/drivers/edac/zynqmp_edac.c
> +++ b/drivers/edac/zynqmp_edac.c
> @@ -426,7 +426,7 @@ static int edac_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int edac_remove(struct platform_device *pdev)
> +static void edac_remove(struct platform_device *pdev)
> {
> struct edac_device_ctl_info *dci = platform_get_drvdata(pdev);
> struct edac_priv *priv = dci->pvt_info;
> @@ -440,8 +440,6 @@ static int edac_remove(struct platform_device *pdev)
>
> edac_device_del_device(&pdev->dev);
> edac_device_free_ctl_info(dci);
> -
> - return 0;
> }
>
> static const struct of_device_id zynqmp_ocm_edac_match[] = {
> @@ -457,7 +455,7 @@ static struct platform_driver zynqmp_ocm_edac_driver = {
> .of_match_table = zynqmp_ocm_edac_match,
> },
> .probe = edac_probe,
> - .remove = edac_remove,
> + .remove_new = edac_remove,
> };
>
> module_platform_driver(zynqmp_ocm_edac_driver);
Acked-by: Michal Simek <michal.simek@amd.com>
Thanks,
Michal
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 13/21] EDAC/octeon-lmc: Convert to platform remove callback returning void
2023-10-04 13:12 ` [PATCH 13/21] EDAC/octeon-lmc: " Uwe Kleine-König
@ 2023-10-10 14:02 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 33+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-10-10 14:02 UTC (permalink / raw)
To: Uwe Kleine-König, Borislav Petkov, Tony Luck
Cc: Ralf Baechle, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-edac, linux-mips, kernel
On 4/10/23 15: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() will be 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/edac/octeon_edac-lmc.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 14/21] EDAC/octeon-pc: Convert to platform remove callback returning void
2023-10-04 13:12 ` [PATCH 14/21] EDAC/octeon-pc: " Uwe Kleine-König
@ 2023-10-10 14:03 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 33+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-10-10 14:03 UTC (permalink / raw)
To: Uwe Kleine-König, Borislav Petkov, Tony Luck
Cc: Ralf Baechle, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-edac, linux-mips, kernel
On 4/10/23 15: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() will be 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/edac/octeon_edac-pc.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 15/21] EDAC/octeon-pci: Convert to platform remove callback returning void
2023-10-04 13:12 ` [PATCH 15/21] EDAC/octeon-pci: " Uwe Kleine-König
@ 2023-10-10 14:03 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 33+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-10-10 14:03 UTC (permalink / raw)
To: Uwe Kleine-König, Borislav Petkov, Tony Luck
Cc: Ralf Baechle, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-edac, linux-mips, kernel
On 4/10/23 15: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() will be 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/edac/octeon_edac-pci.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 12/21] EDAC/octeon-l2c: Convert to platform remove callback returning void
2023-10-04 13:12 ` [PATCH 12/21] EDAC/octeon-l2c: " Uwe Kleine-König
@ 2023-10-10 14:03 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 33+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-10-10 14:03 UTC (permalink / raw)
To: Uwe Kleine-König, Borislav Petkov, Tony Luck
Cc: Ralf Baechle, James Morse, Mauro Carvalho Chehab, Robert Richter,
linux-edac, linux-mips, kernel
On 4/10/23 15: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() will be 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/edac/octeon_edac-l2c.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 33+ messages in thread
* [PATCH 22/21] EDAC/fsl_ddr: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (20 preceding siblings ...)
2023-10-04 13:12 ` [PATCH 21/21] EDAC/zynqmp: " Uwe Kleine-König
@ 2023-10-13 10:04 ` Uwe Kleine-König
2023-11-20 16:20 ` [PATCH 00/21] EDAC: " Uwe Kleine-König
2023-11-20 22:36 ` Borislav Petkov
23 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2023-10-13 10:04 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: York Sun, James Morse, Mauro Carvalho Chehab, Robert Richter,
Johannes Thumshirn, linux-edac
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() will be renamed to .remove().
fsl_mc_err_remove() is used as callback in two drivers. So these have to
be converted together to the void returning remove callback.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,
I found another two drivers to convert that my coccinelle recipe missed.
Best regards
Uwe
drivers/edac/fsl_ddr_edac.c | 3 +--
drivers/edac/fsl_ddr_edac.h | 2 +-
drivers/edac/layerscape_edac.c | 2 +-
drivers/edac/mpc85xx_edac.c | 2 +-
4 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/edac/fsl_ddr_edac.c b/drivers/edac/fsl_ddr_edac.c
index b81757555a8a..d148d262d0d4 100644
--- a/drivers/edac/fsl_ddr_edac.c
+++ b/drivers/edac/fsl_ddr_edac.c
@@ -612,7 +612,7 @@ int fsl_mc_err_probe(struct platform_device *op)
return res;
}
-int fsl_mc_err_remove(struct platform_device *op)
+void fsl_mc_err_remove(struct platform_device *op)
{
struct mem_ctl_info *mci = dev_get_drvdata(&op->dev);
struct fsl_mc_pdata *pdata = mci->pvt_info;
@@ -629,5 +629,4 @@ int fsl_mc_err_remove(struct platform_device *op)
edac_mc_del_mc(&op->dev);
edac_mc_free(mci);
- return 0;
}
diff --git a/drivers/edac/fsl_ddr_edac.h b/drivers/edac/fsl_ddr_edac.h
index 332439d7b2d9..c0994a2a003c 100644
--- a/drivers/edac/fsl_ddr_edac.h
+++ b/drivers/edac/fsl_ddr_edac.h
@@ -72,5 +72,5 @@ struct fsl_mc_pdata {
int irq;
};
int fsl_mc_err_probe(struct platform_device *op);
-int fsl_mc_err_remove(struct platform_device *op);
+void fsl_mc_err_remove(struct platform_device *op);
#endif
diff --git a/drivers/edac/layerscape_edac.c b/drivers/edac/layerscape_edac.c
index 7c5e2b3c0daa..d2f895033280 100644
--- a/drivers/edac/layerscape_edac.c
+++ b/drivers/edac/layerscape_edac.c
@@ -27,7 +27,7 @@ MODULE_DEVICE_TABLE(of, fsl_ddr_mc_err_of_match);
static struct platform_driver fsl_ddr_mc_err_driver = {
.probe = fsl_mc_err_probe,
- .remove = fsl_mc_err_remove,
+ .remove_new = fsl_mc_err_remove,
.driver = {
.name = "fsl_ddr_mc_err",
.of_match_table = fsl_ddr_mc_err_of_match,
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index e0d702cef66f..c1bc53f4e184 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -656,7 +656,7 @@ MODULE_DEVICE_TABLE(of, mpc85xx_mc_err_of_match);
static struct platform_driver mpc85xx_mc_err_driver = {
.probe = fsl_mc_err_probe,
- .remove = fsl_mc_err_remove,
+ .remove_new = fsl_mc_err_remove,
.driver = {
.name = "mpc85xx_mc_err",
.of_match_table = mpc85xx_mc_err_of_match,
--
2.42.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* Re: [PATCH 00/21] EDAC: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (21 preceding siblings ...)
2023-10-13 10:04 ` [PATCH 22/21] EDAC/fsl_ddr: " Uwe Kleine-König
@ 2023-11-20 16:20 ` Uwe Kleine-König
2023-11-20 17:21 ` Borislav Petkov
2023-11-20 22:36 ` Borislav Petkov
23 siblings, 1 reply; 33+ messages in thread
From: Uwe Kleine-König @ 2023-11-20 16:20 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck
Cc: Tomer Maimon, linux-aspeed, Tali Perry, Shubhrajyoti Datta,
Sai Krishna Potthuri, Khuong Dinh, Benjamin Fair, Dinh Nguyen,
openbmc, Nancy Yuen, Andy Gross, Joel Stanley, linux-arm-msm,
Stanley Chu, Robert Richter, Jan Luebbe, Shravan Kumar Ramani,
Manivannan Sadhasivam, Andre Przywara, Mauro Carvalho Chehab,
Michal Simek, linux-arm-kernel, linux-edac, Johannes Thumshirn,
Tero Kristo, Avi Fishman, Patrick Venture, Bjorn Andersson,
linux-mips, Ralf Baechle, Konrad Dybcio, Andrew Jeffery,
James Morse, kernel, Lei Wang, Stefan Schaeckeler, Marvin Lin
[-- Attachment #1: Type: text/plain, Size: 1418 bytes --]
Hello Boris, hello Tony,
On Wed, Oct 04, 2023 at 03:12:33PM +0200, Uwe Kleine-König wrote:
> this series converts all platform drivers below drivers/edac to use
> .remove_new(). The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side. However none of the edac drivers suffered from the easy
> to make bug, so all drivers are converted in a trivial way.
>
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
>
> The patch for npcm was already sent back in June
> (https://lore.kernel.org/linux-edac/20230628071354.665300-1-u.kleine-koenig@pengutronix.de)
> but didn't result in enthusiastic review comments and it wasn't picked
> up.
>
> There are no interdependencies between the patches. As there are still
> quite a few drivers to convert, I'm happy about every patch that makes
> it in. So even if there is a merge conflict with one patch until you
> apply, please apply the remainder of this series anyhow. I'll come back
> to the part that you (maybe) skipped at a later point.
Any news on this series? Would a resend help?
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] 33+ messages in thread
* Re: [PATCH 00/21] EDAC: Convert to platform remove callback returning void
2023-11-20 16:20 ` [PATCH 00/21] EDAC: " Uwe Kleine-König
@ 2023-11-20 17:21 ` Borislav Petkov
0 siblings, 0 replies; 33+ messages in thread
From: Borislav Petkov @ 2023-11-20 17:21 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Tony Luck, Tomer Maimon, linux-aspeed, Tali Perry,
Shubhrajyoti Datta, Sai Krishna Potthuri, Khuong Dinh,
Benjamin Fair, Dinh Nguyen, openbmc, Nancy Yuen, Andy Gross,
Joel Stanley, linux-arm-msm, Stanley Chu, Robert Richter,
Jan Luebbe, Shravan Kumar Ramani, Manivannan Sadhasivam,
Andre Przywara, Mauro Carvalho Chehab, Michal Simek,
linux-arm-kernel, linux-edac, Johannes Thumshirn, Tero Kristo,
Avi Fishman, Patrick Venture, Bjorn Andersson, linux-mips,
Ralf Baechle, Konrad Dybcio, Andrew Jeffery, James Morse, kernel,
Lei Wang, Stefan Schaeckeler, Marvin Lin
On Mon, Nov 20, 2023 at 05:20:54PM +0100, Uwe Kleine-König wrote:
> Any news on this series? Would a resend help?
Nah, lemme have a look.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 09/21] EDAC/highbank_mc: Convert to platform remove callback returning void
2023-10-04 13:12 ` [PATCH 09/21] EDAC/highbank_mc: " Uwe Kleine-König
@ 2023-11-20 17:45 ` Andre Przywara
0 siblings, 0 replies; 33+ messages in thread
From: Andre Przywara @ 2023-11-20 17:45 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Borislav Petkov, Tony Luck, James Morse, Mauro Carvalho Chehab,
Robert Richter, linux-edac, kernel
On Wed, 4 Oct 2023 15:12:42 +0200
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() will be 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: Andre Przywara <andre.przywara@arm.com>
Cheers,
Andre
> ---
> drivers/edac/highbank_mc_edac.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/edac/highbank_mc_edac.c b/drivers/edac/highbank_mc_edac.c
> index a0c04a7f95e9..1c5b888ab11d 100644
> --- a/drivers/edac/highbank_mc_edac.c
> +++ b/drivers/edac/highbank_mc_edac.c
> @@ -251,18 +251,17 @@ static int highbank_mc_probe(struct platform_device *pdev)
> return res;
> }
>
> -static int highbank_mc_remove(struct platform_device *pdev)
> +static void highbank_mc_remove(struct platform_device *pdev)
> {
> struct mem_ctl_info *mci = platform_get_drvdata(pdev);
>
> edac_mc_del_mc(&pdev->dev);
> edac_mc_free(mci);
> - return 0;
> }
>
> static struct platform_driver highbank_mc_edac_driver = {
> .probe = highbank_mc_probe,
> - .remove = highbank_mc_remove,
> + .remove_new = highbank_mc_remove,
> .driver = {
> .name = "hb_mc_edac",
> .of_match_table = hb_ddr_ctrl_of_match,
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 08/21] EDAC/highbank_l2: Convert to platform remove callback returning void
2023-10-04 13:12 ` [PATCH 08/21] EDAC/highbank_l2: " Uwe Kleine-König
@ 2023-11-20 17:45 ` Andre Przywara
0 siblings, 0 replies; 33+ messages in thread
From: Andre Przywara @ 2023-11-20 17:45 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Borislav Petkov, Tony Luck, James Morse, Mauro Carvalho Chehab,
Robert Richter, linux-edac, kernel
On Wed, 4 Oct 2023 15:12:41 +0200
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
Hi,
> 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() will be 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: Andre Przywara <andre.przywara@arm.com>
Cheers,
Andre
> ---
> drivers/edac/highbank_l2_edac.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/edac/highbank_l2_edac.c b/drivers/edac/highbank_l2_edac.c
> index 140d4431bd0d..5646c049a934 100644
> --- a/drivers/edac/highbank_l2_edac.c
> +++ b/drivers/edac/highbank_l2_edac.c
> @@ -118,18 +118,17 @@ static int highbank_l2_err_probe(struct platform_device *pdev)
> return res;
> }
>
> -static int highbank_l2_err_remove(struct platform_device *pdev)
> +static void highbank_l2_err_remove(struct platform_device *pdev)
> {
> struct edac_device_ctl_info *dci = platform_get_drvdata(pdev);
>
> edac_device_del_device(&pdev->dev);
> edac_device_free_ctl_info(dci);
> - return 0;
> }
>
> static struct platform_driver highbank_l2_edac_driver = {
> .probe = highbank_l2_err_probe,
> - .remove = highbank_l2_err_remove,
> + .remove_new = highbank_l2_err_remove,
> .driver = {
> .name = "hb_l2_edac",
> .of_match_table = hb_l2_err_of_match,
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 00/21] EDAC: Convert to platform remove callback returning void
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
` (22 preceding siblings ...)
2023-11-20 16:20 ` [PATCH 00/21] EDAC: " Uwe Kleine-König
@ 2023-11-20 22:36 ` Borislav Petkov
23 siblings, 0 replies; 33+ messages in thread
From: Borislav Petkov @ 2023-11-20 22:36 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Tony Luck, Dinh Nguyen, James Morse, Mauro Carvalho Chehab,
Robert Richter, linux-edac, kernel, Jan Luebbe,
Stefan Schaeckeler, Joel Stanley, Andrew Jeffery,
linux-arm-kernel, linux-aspeed, Shravan Kumar Ramani, Lei Wang,
Andre Przywara, Johannes Thumshirn, Avi Fishman, Tomer Maimon,
Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
Marvin Lin, Stanley Chu, openbmc, Ralf Baechle, linux-mips,
Manivannan Sadhasivam, Andy Gross, Bjorn Andersson, Konrad Dybcio,
linux-arm-msm, Michal Simek, Tero Kristo, Khuong Dinh,
Shubhrajyoti Datta, Sai Krishna Potthuri
On Wed, Oct 04, 2023 at 03:12:33PM +0200, Uwe Kleine-König wrote:
> Uwe Kleine-König (21):
> EDAC/altera: Convert to platform remove callback returning void
> EDAC/armada_xp: Convert to platform remove callback returning void
> EDAC/aspeed: Convert to platform remove callback returning void
> EDAC/bluefield: Convert to platform remove callback returning void
> EDAC/cell: Convert to platform remove callback returning void
> EDAC/cpc925: Convert to platform remove callback returning void
> EDAC/dmc520: Convert to platform remove callback returning void
> EDAC/highbank_l2: Convert to platform remove callback returning void
> EDAC/highbank_mc: Convert to platform remove callback returning void
> EDAC/mpc85xx: Convert to platform remove callback returning void
> EDAC/npcm: Convert to platform remove callback returning void
> EDAC/octeon-l2c: Convert to platform remove callback returning void
> EDAC/octeon-lmc: Convert to platform remove callback returning void
> EDAC/octeon-pc: Convert to platform remove callback returning void
> EDAC/octeon-pci: Convert to platform remove callback returning void
> EDAC/ppc4xx: Convert to platform remove callback returning void
> EDAC/qcom: Convert to platform remove callback returning void
> EDAC/synopsys: Convert to platform remove callback returning void
> EDAC/ti: Convert to platform remove callback returning void
> EDAC/xgene: Convert to platform remove callback returning void
> EDAC/zynqmp: Convert to platform remove callback returning void
All applied, thanks.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 33+ messages in thread
end of thread, other threads:[~2023-11-20 22:37 UTC | newest]
Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-04 13:12 [PATCH 00/21] EDAC: Convert to platform remove callback returning void Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 01/21] EDAC/altera: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 02/21] EDAC/armada_xp: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 03/21] EDAC/aspeed: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 04/21] EDAC/bluefield: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 05/21] EDAC/cell: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 06/21] EDAC/cpc925: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 07/21] EDAC/dmc520: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 08/21] EDAC/highbank_l2: " Uwe Kleine-König
2023-11-20 17:45 ` Andre Przywara
2023-10-04 13:12 ` [PATCH 09/21] EDAC/highbank_mc: " Uwe Kleine-König
2023-11-20 17:45 ` Andre Przywara
2023-10-04 13:12 ` [PATCH 10/21] EDAC/mpc85xx: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 11/21] EDAC/npcm: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 12/21] EDAC/octeon-l2c: " Uwe Kleine-König
2023-10-10 14:03 ` Philippe Mathieu-Daudé
2023-10-04 13:12 ` [PATCH 13/21] EDAC/octeon-lmc: " Uwe Kleine-König
2023-10-10 14:02 ` Philippe Mathieu-Daudé
2023-10-04 13:12 ` [PATCH 14/21] EDAC/octeon-pc: " Uwe Kleine-König
2023-10-10 14:03 ` Philippe Mathieu-Daudé
2023-10-04 13:12 ` [PATCH 15/21] EDAC/octeon-pci: " Uwe Kleine-König
2023-10-10 14:03 ` Philippe Mathieu-Daudé
2023-10-04 13:12 ` [PATCH 16/21] EDAC/ppc4xx: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 17/21] EDAC/qcom: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 18/21] EDAC/synopsys: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 19/21] EDAC/ti: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 20/21] EDAC/xgene: " Uwe Kleine-König
2023-10-04 13:12 ` [PATCH 21/21] EDAC/zynqmp: " Uwe Kleine-König
2023-10-04 13:14 ` Michal Simek
2023-10-13 10:04 ` [PATCH 22/21] EDAC/fsl_ddr: " Uwe Kleine-König
2023-11-20 16:20 ` [PATCH 00/21] EDAC: " Uwe Kleine-König
2023-11-20 17:21 ` Borislav Petkov
2023-11-20 22:36 ` Borislav Petkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox