diff options
author | Li Yang <leoyang.li@nxp.com> | 2021-09-20 17:29:22 -0500 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2021-11-30 15:01:42 +0800 |
commit | 2acaf768253252ff25e53bb7c6d010fb9eee55f4 (patch) | |
tree | aa5bbce8ec0889d3cebc80fc9933d24125a7d366 /drivers/pwm | |
parent | 05181078d7be0352dacc05f653f0607a124e2ab6 (diff) |
pwm: rpmsg-imx: 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: Li Yang <leoyang.li@nxp.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r-- | drivers/pwm/pwm-rpmsg-imx.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/pwm/pwm-rpmsg-imx.c b/drivers/pwm/pwm-rpmsg-imx.c index 070ad46f36bf..c1b7c1123e62 100644 --- a/drivers/pwm/pwm-rpmsg-imx.c +++ b/drivers/pwm/pwm-rpmsg-imx.c @@ -385,7 +385,7 @@ static int pwm_rpchip_probe(struct platform_device *pdev) platform_set_drvdata(pdev, rdata); - ret = pwmchip_add(&rdata->chip); + ret = devm_pwmchip_add(&pdev->dev, &rdata->chip); if (ret) { dev_err(&pdev->dev, "failed to add PWM chip: %d\n", ret); return ret; @@ -393,14 +393,7 @@ static int pwm_rpchip_probe(struct platform_device *pdev) dev_info(dev, "add PWM chip %d successfully\n", rdata->chip_id); - return 0; -} - -static int pwm_rpchip_remove(struct platform_device *pdev) -{ - struct imx_rpmsg_pwm_data *rdata = platform_get_drvdata(pdev); - - return pwmchip_remove(&rdata->chip); + return ret; } static const struct of_device_id imx_rpmsg_pwm_dt_ids[] = { @@ -415,7 +408,6 @@ static struct platform_driver imx_rpmsg_pwm_driver = { .of_match_table = imx_rpmsg_pwm_dt_ids, }, .probe = pwm_rpchip_probe, - .remove = pwm_rpchip_remove }; static int __init imx_rpmsg_pwm_driver_init(void) |