Skip to content

Commit 23a35fd

Browse files
Uwe Kleine-Königlinusw
authored andcommitted
pinctrl: amd: 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]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent a304b56 commit 23a35fd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pinctrl/pinctrl-amd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,16 +1166,14 @@ static int amd_gpio_probe(struct platform_device *pdev)
11661166
return ret;
11671167
}
11681168

1169-
static int amd_gpio_remove(struct platform_device *pdev)
1169+
static void amd_gpio_remove(struct platform_device *pdev)
11701170
{
11711171
struct amd_gpio *gpio_dev;
11721172

11731173
gpio_dev = platform_get_drvdata(pdev);
11741174

11751175
gpiochip_remove(&gpio_dev->gc);
11761176
acpi_unregister_wakeup_handler(amd_gpio_check_wake, gpio_dev);
1177-
1178-
return 0;
11791177
}
11801178

11811179
#ifdef CONFIG_ACPI
@@ -1197,7 +1195,7 @@ static struct platform_driver amd_gpio_driver = {
11971195
#endif
11981196
},
11991197
.probe = amd_gpio_probe,
1200-
.remove = amd_gpio_remove,
1198+
.remove_new = amd_gpio_remove,
12011199
};
12021200

12031201
module_platform_driver(amd_gpio_driver);

0 commit comments

Comments
 (0)