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>
This commit is contained in:
parent
91e92e82b1
commit
22e1d1f44d
|
@ -279,20 +279,18 @@ static int vt8500_pwm_probe(struct platform_device *pdev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vt8500_pwm_remove(struct platform_device *pdev)
|
static void vt8500_pwm_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct vt8500_chip *vt8500 = platform_get_drvdata(pdev);
|
struct vt8500_chip *vt8500 = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
pwmchip_remove(&vt8500->chip);
|
pwmchip_remove(&vt8500->chip);
|
||||||
|
|
||||||
clk_unprepare(vt8500->clk);
|
clk_unprepare(vt8500->clk);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct platform_driver vt8500_pwm_driver = {
|
static struct platform_driver vt8500_pwm_driver = {
|
||||||
.probe = vt8500_pwm_probe,
|
.probe = vt8500_pwm_probe,
|
||||||
.remove = vt8500_pwm_remove,
|
.remove_new = vt8500_pwm_remove,
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "vt8500-pwm",
|
.name = "vt8500-pwm",
|
||||||
.of_match_table = vt8500_pwm_dt_ids,
|
.of_match_table = vt8500_pwm_dt_ids,
|
||||||
|
|
Loading…
Reference in New Issue