Skip to content

Commit 1d4f997

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: samsung: 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 18a95d3 commit 1d4f997

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/pwm/pwm-samsung.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,15 +621,13 @@ static int pwm_samsung_probe(struct platform_device *pdev)
621621
return 0;
622622
}
623623

624-
static int pwm_samsung_remove(struct platform_device *pdev)
624+
static void pwm_samsung_remove(struct platform_device *pdev)
625625
{
626626
struct samsung_pwm_chip *chip = platform_get_drvdata(pdev);
627627

628628
pwmchip_remove(&chip->chip);
629629

630630
clk_disable_unprepare(chip->base_clk);
631-
632-
return 0;
633631
}
634632

635633
#ifdef CONFIG_PM_SLEEP
@@ -676,7 +674,7 @@ static struct platform_driver pwm_samsung_driver = {
676674
.of_match_table = of_match_ptr(samsung_pwm_matches),
677675
},
678676
.probe = pwm_samsung_probe,
679-
.remove = pwm_samsung_remove,
677+
.remove_new = pwm_samsung_remove,
680678
};
681679
module_platform_driver(pwm_samsung_driver);
682680

0 commit comments

Comments
 (0)