Commit 0c7c7ba0 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Borislav Petkov (AMD)

EDAC/fsl_ddr: Convert to platform remove callback returning void

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20231013100422.1382040-2-u.kleine-koenig@pengutronix.de
parent ec886cf8
...@@ -612,7 +612,7 @@ int fsl_mc_err_probe(struct platform_device *op) ...@@ -612,7 +612,7 @@ int fsl_mc_err_probe(struct platform_device *op)
return res; 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 mem_ctl_info *mci = dev_get_drvdata(&op->dev);
struct fsl_mc_pdata *pdata = mci->pvt_info; struct fsl_mc_pdata *pdata = mci->pvt_info;
...@@ -629,5 +629,4 @@ int fsl_mc_err_remove(struct platform_device *op) ...@@ -629,5 +629,4 @@ int fsl_mc_err_remove(struct platform_device *op)
edac_mc_del_mc(&op->dev); edac_mc_del_mc(&op->dev);
edac_mc_free(mci); edac_mc_free(mci);
return 0;
} }
...@@ -72,5 +72,5 @@ struct fsl_mc_pdata { ...@@ -72,5 +72,5 @@ struct fsl_mc_pdata {
int irq; int irq;
}; };
int fsl_mc_err_probe(struct platform_device *op); 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 #endif
...@@ -27,7 +27,7 @@ MODULE_DEVICE_TABLE(of, fsl_ddr_mc_err_of_match); ...@@ -27,7 +27,7 @@ MODULE_DEVICE_TABLE(of, fsl_ddr_mc_err_of_match);
static struct platform_driver fsl_ddr_mc_err_driver = { static struct platform_driver fsl_ddr_mc_err_driver = {
.probe = fsl_mc_err_probe, .probe = fsl_mc_err_probe,
.remove = fsl_mc_err_remove, .remove_new = fsl_mc_err_remove,
.driver = { .driver = {
.name = "fsl_ddr_mc_err", .name = "fsl_ddr_mc_err",
.of_match_table = fsl_ddr_mc_err_of_match, .of_match_table = fsl_ddr_mc_err_of_match,
......
...@@ -656,7 +656,7 @@ MODULE_DEVICE_TABLE(of, mpc85xx_mc_err_of_match); ...@@ -656,7 +656,7 @@ MODULE_DEVICE_TABLE(of, mpc85xx_mc_err_of_match);
static struct platform_driver mpc85xx_mc_err_driver = { static struct platform_driver mpc85xx_mc_err_driver = {
.probe = fsl_mc_err_probe, .probe = fsl_mc_err_probe,
.remove = fsl_mc_err_remove, .remove_new = fsl_mc_err_remove,
.driver = { .driver = {
.name = "mpc85xx_mc_err", .name = "mpc85xx_mc_err",
.of_match_table = mpc85xx_mc_err_of_match, .of_match_table = mpc85xx_mc_err_of_match,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment