forked from Minki/linux
pwm: fsl-ftm: Simplify using devm_pwmchip_add()
This allows to drop the platform_driver's remove function. 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
a0b336a352
commit
5ba3eb4bb3
@ -453,7 +453,7 @@ static int fsl_pwm_probe(struct platform_device *pdev)
|
||||
fpc->chip.ops = &fsl_pwm_ops;
|
||||
fpc->chip.npwm = 8;
|
||||
|
||||
ret = pwmchip_add(&fpc->chip);
|
||||
ret = devm_pwmchip_add(&pdev->dev, &fpc->chip);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "failed to add PWM chip: %d\n", ret);
|
||||
return ret;
|
||||
@ -464,13 +464,6 @@ static int fsl_pwm_probe(struct platform_device *pdev)
|
||||
return fsl_pwm_init(fpc);
|
||||
}
|
||||
|
||||
static int fsl_pwm_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct fsl_pwm_chip *fpc = platform_get_drvdata(pdev);
|
||||
|
||||
return pwmchip_remove(&fpc->chip);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int fsl_pwm_suspend(struct device *dev)
|
||||
{
|
||||
@ -552,7 +545,6 @@ static struct platform_driver fsl_pwm_driver = {
|
||||
.pm = &fsl_pwm_pm_ops,
|
||||
},
|
||||
.probe = fsl_pwm_probe,
|
||||
.remove = fsl_pwm_remove,
|
||||
};
|
||||
module_platform_driver(fsl_pwm_driver);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user