mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 07:23:14 +00:00
power: supply: wm8350_power: 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() is 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> Link: https://lore.kernel.org/r/20230918133700.1254499-32-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
dab68bbb54
commit
42720969f3
@ -579,7 +579,7 @@ static int wm8350_power_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int wm8350_power_remove(struct platform_device *pdev)
|
||||
static void wm8350_power_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct wm8350 *wm8350 = platform_get_drvdata(pdev);
|
||||
struct wm8350_power *power = &wm8350->power;
|
||||
@ -589,12 +589,11 @@ static int wm8350_power_remove(struct platform_device *pdev)
|
||||
power_supply_unregister(power->battery);
|
||||
power_supply_unregister(power->ac);
|
||||
power_supply_unregister(power->usb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver wm8350_power_driver = {
|
||||
.probe = wm8350_power_probe,
|
||||
.remove = wm8350_power_remove,
|
||||
.remove_new = wm8350_power_remove,
|
||||
.driver = {
|
||||
.name = "wm8350-power",
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user