summaryrefslogtreecommitdiffstats
path: root/drivers/cdx
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2024-03-08 09:51:05 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-13 12:41:01 +0200
commit4b9f86214c054ea2da2917f6c107b34f7076c181 (patch)
tree209fed19a967bc362cab343d75d6e98bb4b23399 /drivers/cdx
parentMerge tag 'counter-updates-for-6.10' of git://git.kernel.org/pub/scm/linux/ke... (diff)
downloadlinux-4b9f86214c054ea2da2917f6c107b34f7076c181.tar.xz
linux-4b9f86214c054ea2da2917f6c107b34f7076c181.zip
cdx: 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(). 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: Nipun Gupta <nipun.gupta@amd.com> Link: https://lore.kernel.org/r/5d40f57e978bcce003133306712ec96439e93595.1709886922.git.u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/cdx')
-rw-r--r--drivers/cdx/controller/cdx_controller.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/cdx/controller/cdx_controller.c b/drivers/cdx/controller/cdx_controller.c
index 112a1541de6d..201f9a6fbde7 100644
--- a/drivers/cdx/controller/cdx_controller.c
+++ b/drivers/cdx/controller/cdx_controller.c
@@ -222,7 +222,7 @@ mcdi_init_fail:
return ret;
}
-static int xlnx_cdx_remove(struct platform_device *pdev)
+static void xlnx_cdx_remove(struct platform_device *pdev)
{
struct cdx_controller *cdx = platform_get_drvdata(pdev);
struct cdx_mcdi *cdx_mcdi = cdx->priv;
@@ -234,8 +234,6 @@ static int xlnx_cdx_remove(struct platform_device *pdev)
cdx_mcdi_finish(cdx_mcdi);
kfree(cdx_mcdi);
-
- return 0;
}
static const struct of_device_id cdx_match_table[] = {
@@ -252,7 +250,7 @@ static struct platform_driver cdx_pdriver = {
.of_match_table = cdx_match_table,
},
.probe = xlnx_cdx_probe,
- .remove = xlnx_cdx_remove,
+ .remove_new = xlnx_cdx_remove,
};
static int __init cdx_controller_init(void)