Skip to content

Commit 22e1d1f

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: vt8500: 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 91e92e8 commit 22e1d1f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/pwm/pwm-vt8500.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,20 +279,18 @@ static int vt8500_pwm_probe(struct platform_device *pdev)
279279
return ret;
280280
}
281281

282-
static int vt8500_pwm_remove(struct platform_device *pdev)
282+
static void vt8500_pwm_remove(struct platform_device *pdev)
283283
{
284284
struct vt8500_chip *vt8500 = platform_get_drvdata(pdev);
285285

286286
pwmchip_remove(&vt8500->chip);
287287

288288
clk_unprepare(vt8500->clk);
289-
290-
return 0;
291289
}
292290

293291
static struct platform_driver vt8500_pwm_driver = {
294292
.probe = vt8500_pwm_probe,
295-
.remove = vt8500_pwm_remove,
293+
.remove_new = vt8500_pwm_remove,
296294
.driver = {
297295
.name = "vt8500-pwm",
298296
.of_match_table = vt8500_pwm_dt_ids,

0 commit comments

Comments
 (0)