Skip to content

Commit bcc0403

Browse files
Uwe Kleine-KönigIngo Molnar
authored andcommitted
x86/platform/iris: 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 <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/adb9b0aca77d7aa8e54d0a664a4ee290834a60a1.1712732665.git.u.kleine-koenig@pengutronix.de
1 parent f87136c commit bcc0403

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/x86/platform/iris/iris.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,18 @@ static int iris_probe(struct platform_device *pdev)
6262
return 0;
6363
}
6464

65-
static int iris_remove(struct platform_device *pdev)
65+
static void iris_remove(struct platform_device *pdev)
6666
{
6767
pm_power_off = old_pm_power_off;
6868
printk(KERN_INFO "Iris power_off handler uninstalled.\n");
69-
return 0;
7069
}
7170

7271
static struct platform_driver iris_driver = {
7372
.driver = {
7473
.name = "iris",
7574
},
7675
.probe = iris_probe,
77-
.remove = iris_remove,
76+
.remove_new = iris_remove,
7877
};
7978

8079
static struct resource iris_resources[] = {

0 commit comments

Comments
 (0)