diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2021-07-07 18:28:12 +0200 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2021-09-02 21:38:45 +0200 |
commit | 43f5f48d095c31e67777c41ad3ee65186f384b03 (patch) | |
tree | c04897f8ecbdacaa377a0a2202f7ed2fcaad828a | |
parent | e0150252a6437d12de3db84bb3af12bd5aa5cc70 (diff) | |
download | linux-stable-43f5f48d095c31e67777c41ad3ee65186f384b03.tar.gz linux-stable-43f5f48d095c31e67777c41ad3ee65186f384b03.tar.bz2 linux-stable-43f5f48d095c31e67777c41ad3ee65186f384b03.zip |
pwm: mxs: 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>
-rw-r--r-- | drivers/pwm/pwm-mxs.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c index 558dc1de8f5d..766dbc58dad8 100644 --- a/drivers/pwm/pwm-mxs.c +++ b/drivers/pwm/pwm-mxs.c @@ -150,24 +150,15 @@ static int mxs_pwm_probe(struct platform_device *pdev) if (ret) return dev_err_probe(&pdev->dev, ret, "failed to reset PWM\n"); - ret = pwmchip_add(&mxs->chip); + ret = devm_pwmchip_add(&pdev->dev, &mxs->chip); if (ret < 0) { dev_err(&pdev->dev, "failed to add pwm chip %d\n", ret); return ret; } - platform_set_drvdata(pdev, mxs); - return 0; } -static int mxs_pwm_remove(struct platform_device *pdev) -{ - struct mxs_pwm_chip *mxs = platform_get_drvdata(pdev); - - return pwmchip_remove(&mxs->chip); -} - static const struct of_device_id mxs_pwm_dt_ids[] = { { .compatible = "fsl,imx23-pwm", }, { /* sentinel */ } @@ -180,7 +171,6 @@ static struct platform_driver mxs_pwm_driver = { .of_match_table = mxs_pwm_dt_ids, }, .probe = mxs_pwm_probe, - .remove = mxs_pwm_remove, }; module_platform_driver(mxs_pwm_driver); |