Skip to content

Commit dc75f6b

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: tiecap: 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 (mostly) ignored 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. 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: Thierry Reding <thierry.reding@gmail.com>
1 parent e39cb6f commit dc75f6b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/pwm/pwm-tiecap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,9 @@ static int ecap_pwm_probe(struct platform_device *pdev)
265265
return 0;
266266
}
267267

268-
static int ecap_pwm_remove(struct platform_device *pdev)
268+
static void ecap_pwm_remove(struct platform_device *pdev)
269269
{
270270
pm_runtime_disable(&pdev->dev);
271-
272-
return 0;
273271
}
274272

275273
#ifdef CONFIG_PM_SLEEP
@@ -326,7 +324,7 @@ static struct platform_driver ecap_pwm_driver = {
326324
.pm = &ecap_pwm_pm_ops,
327325
},
328326
.probe = ecap_pwm_probe,
329-
.remove = ecap_pwm_remove,
327+
.remove_new = ecap_pwm_remove,
330328
};
331329
module_platform_driver(ecap_pwm_driver);
332330

0 commit comments

Comments
 (0)