@@ -399,7 +399,7 @@ static int tegra_pwm_probe(struct platform_device *pdev)
chip->ops = &tegra_pwm_ops;
- ret = pwmchip_add(chip);
+ ret = devm_pwmchip_add(dev, chip);
if (ret < 0) {
dev_err_probe(dev, ret, "Adding pwmchip failed\n");
goto put_pm;
@@ -413,13 +413,6 @@ static int tegra_pwm_probe(struct platform_device *pdev)
return ret;
}
-static void tegra_pwm_remove(struct platform_device *pdev)
-{
- struct pwm_chip *chip = platform_get_drvdata(pdev);
-
- pwmchip_remove(chip);
-}
-
static int __maybe_unused tegra_pwm_runtime_suspend(struct device *dev)
{
struct pwm_chip *chip = dev_get_drvdata(dev);
@@ -497,7 +490,6 @@ static struct platform_driver tegra_pwm_driver = {
.pm = &tegra_pwm_pm_ops,
},
.probe = tegra_pwm_probe,
- .remove = tegra_pwm_remove,
};
module_platform_driver(tegra_pwm_driver);
devm_pwmchip_add() makes the device core cope for calling pwmchip_remove() at unbind time. This way the remove callback becomes empty and can be dropped. Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org> --- drivers/pwm/pwm-tegra.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)