diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2021-07-07 18:28:00 +0200 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2021-09-02 21:38:40 +0200 |
commit | 14ac9e17f9bd4bd0dfe18e384a3c2ca8dfbffcc8 (patch) | |
tree | af15abf784f07be307992780e884022fded56a7b /drivers/pwm | |
parent | cf83f7b7ae765e3d5eed65f8186c8d6ff320722d (diff) |
pwm: ab8500: Simplify using devm_pwmchip_add()
This allows to drop the platform_driver's remove function. This is the
only user of driver data so this can go away, too.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r-- | drivers/pwm/pwm-ab8500.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/pwm/pwm-ab8500.c b/drivers/pwm/pwm-ab8500.c index 281f74a1c50b..ad37bc46f272 100644 --- a/drivers/pwm/pwm-ab8500.c +++ b/drivers/pwm/pwm-ab8500.c @@ -111,26 +111,11 @@ static int ab8500_pwm_probe(struct platform_device *pdev) ab8500->chip.npwm = 1; ab8500->hwid = pdev->id - 1; - err = pwmchip_add(&ab8500->chip); + err = devm_pwmchip_add(&pdev->dev, &ab8500->chip); if (err < 0) return dev_err_probe(&pdev->dev, err, "Failed to add pwm chip\n"); dev_dbg(&pdev->dev, "pwm probe successful\n"); - platform_set_drvdata(pdev, ab8500); - - return 0; -} - -static int ab8500_pwm_remove(struct platform_device *pdev) -{ - struct ab8500_pwm_chip *ab8500 = platform_get_drvdata(pdev); - int err; - - err = pwmchip_remove(&ab8500->chip); - if (err < 0) - return err; - - dev_dbg(&pdev->dev, "pwm driver removed\n"); return 0; } @@ -140,7 +125,6 @@ static struct platform_driver ab8500_pwm_driver = { .name = "ab8500-pwm", }, .probe = ab8500_pwm_probe, - .remove = ab8500_pwm_remove, }; module_platform_driver(ab8500_pwm_driver); |