diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2021-07-07 18:28:10 +0200 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2021-09-02 21:38:44 +0200 |
commit | da68a9f4b03cb090bf725595815782a5c6b38937 (patch) | |
tree | 750090e0aa1d4482973d3e10c7498c535858d5d9 /drivers/pwm | |
parent | 071beb7c5ee37e778f8a85c95e271d93f0e6ffef (diff) |
pwm: lpc32xx: 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-lpc32xx.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/pwm/pwm-lpc32xx.c b/drivers/pwm/pwm-lpc32xx.c index 719e8e913656..ddeab5687cb8 100644 --- a/drivers/pwm/pwm-lpc32xx.c +++ b/drivers/pwm/pwm-lpc32xx.c @@ -122,24 +122,15 @@ static int lpc32xx_pwm_probe(struct platform_device *pdev) val &= ~PWM_PIN_LEVEL; writel(val, lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2)); - ret = pwmchip_add(&lpc32xx->chip); + ret = devm_pwmchip_add(&pdev->dev, &lpc32xx->chip); if (ret < 0) { dev_err(&pdev->dev, "failed to add PWM chip, error %d\n", ret); return ret; } - platform_set_drvdata(pdev, lpc32xx); - return 0; } -static int lpc32xx_pwm_remove(struct platform_device *pdev) -{ - struct lpc32xx_pwm_chip *lpc32xx = platform_get_drvdata(pdev); - - return pwmchip_remove(&lpc32xx->chip); -} - static const struct of_device_id lpc32xx_pwm_dt_ids[] = { { .compatible = "nxp,lpc3220-pwm", }, { /* sentinel */ } @@ -152,7 +143,6 @@ static struct platform_driver lpc32xx_pwm_driver = { .of_match_table = lpc32xx_pwm_dt_ids, }, .probe = lpc32xx_pwm_probe, - .remove = lpc32xx_pwm_remove, }; module_platform_driver(lpc32xx_pwm_driver); |