Skip to content

Commit e13cec3

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: sti: 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 c516380 commit e13cec3

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/pwm/pwm-sti.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -669,16 +669,14 @@ static int sti_pwm_probe(struct platform_device *pdev)
669669
return 0;
670670
}
671671

672-
static int sti_pwm_remove(struct platform_device *pdev)
672+
static void sti_pwm_remove(struct platform_device *pdev)
673673
{
674674
struct sti_pwm_chip *pc = platform_get_drvdata(pdev);
675675

676676
pwmchip_remove(&pc->chip);
677677

678678
clk_unprepare(pc->pwm_clk);
679679
clk_unprepare(pc->cpt_clk);
680-
681-
return 0;
682680
}
683681

684682
static const struct of_device_id sti_pwm_of_match[] = {
@@ -693,7 +691,7 @@ static struct platform_driver sti_pwm_driver = {
693691
.of_match_table = sti_pwm_of_match,
694692
},
695693
.probe = sti_pwm_probe,
696-
.remove = sti_pwm_remove,
694+
.remove_new = sti_pwm_remove,
697695
};
698696
module_platform_driver(sti_pwm_driver);
699697

0 commit comments

Comments
 (0)