Skip to content

Commit e39cb6f

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: tegra: 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 0bda6b0 commit e39cb6f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/pwm/pwm-tegra.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ static int tegra_pwm_probe(struct platform_device *pdev)
350350
return ret;
351351
}
352352

353-
static int tegra_pwm_remove(struct platform_device *pdev)
353+
static void tegra_pwm_remove(struct platform_device *pdev)
354354
{
355355
struct tegra_pwm_chip *pc = platform_get_drvdata(pdev);
356356

@@ -359,8 +359,6 @@ static int tegra_pwm_remove(struct platform_device *pdev)
359359
reset_control_assert(pc->rst);
360360

361361
pm_runtime_force_suspend(&pdev->dev);
362-
363-
return 0;
364362
}
365363

366364
static int __maybe_unused tegra_pwm_runtime_suspend(struct device *dev)
@@ -434,7 +432,7 @@ static struct platform_driver tegra_pwm_driver = {
434432
.pm = &tegra_pwm_pm_ops,
435433
},
436434
.probe = tegra_pwm_probe,
437-
.remove = tegra_pwm_remove,
435+
.remove_new = tegra_pwm_remove,
438436
};
439437

440438
module_platform_driver(tegra_pwm_driver);

0 commit comments

Comments
 (0)