Skip to content

Commit 984e5c7

Browse files
Uwe Kleine-KönigKAGA-KOKO
authored andcommitted
irqchip/imx-intmux: Convert to platform_driver::remove_new() callback
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> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/edeee074956dd943d3c67da894a01dc5f0d33bd7.1703284359.git.u.kleine-koenig@pengutronix.de
1 parent b7357ec commit 984e5c7

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

drivers/irqchip/irq-imx-intmux.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static int imx_intmux_probe(struct platform_device *pdev)
282282
return ret;
283283
}
284284

285-
static int imx_intmux_remove(struct platform_device *pdev)
285+
static void imx_intmux_remove(struct platform_device *pdev)
286286
{
287287
struct intmux_data *data = platform_get_drvdata(pdev);
288288
int i;
@@ -298,8 +298,6 @@ static int imx_intmux_remove(struct platform_device *pdev)
298298
}
299299

300300
pm_runtime_disable(&pdev->dev);
301-
302-
return 0;
303301
}
304302

305303
#ifdef CONFIG_PM
@@ -354,11 +352,11 @@ static const struct of_device_id imx_intmux_id[] = {
354352

355353
static struct platform_driver imx_intmux_driver = {
356354
.driver = {
357-
.name = "imx-intmux",
358-
.of_match_table = imx_intmux_id,
359-
.pm = &imx_intmux_pm_ops,
355+
.name = "imx-intmux",
356+
.of_match_table = imx_intmux_id,
357+
.pm = &imx_intmux_pm_ops,
360358
},
361-
.probe = imx_intmux_probe,
362-
.remove = imx_intmux_remove,
359+
.probe = imx_intmux_probe,
360+
.remove_new = imx_intmux_remove,
363361
};
364362
builtin_platform_driver(imx_intmux_driver);

0 commit comments

Comments
 (0)