mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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>
This commit is contained in:
parent
e0150252a6
commit
43f5f48d09
1 changed files with 1 additions and 11 deletions
|
@ -150,24 +150,15 @@ static int mxs_pwm_probe(struct platform_device *pdev)
|
||||||
if (ret)
|
if (ret)
|
||||||
return dev_err_probe(&pdev->dev, ret, "failed to reset PWM\n");
|
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) {
|
if (ret < 0) {
|
||||||
dev_err(&pdev->dev, "failed to add pwm chip %d\n", ret);
|
dev_err(&pdev->dev, "failed to add pwm chip %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
platform_set_drvdata(pdev, mxs);
|
|
||||||
|
|
||||||
return 0;
|
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[] = {
|
static const struct of_device_id mxs_pwm_dt_ids[] = {
|
||||||
{ .compatible = "fsl,imx23-pwm", },
|
{ .compatible = "fsl,imx23-pwm", },
|
||||||
{ /* sentinel */ }
|
{ /* sentinel */ }
|
||||||
|
@ -180,7 +171,6 @@ static struct platform_driver mxs_pwm_driver = {
|
||||||
.of_match_table = mxs_pwm_dt_ids,
|
.of_match_table = mxs_pwm_dt_ids,
|
||||||
},
|
},
|
||||||
.probe = mxs_pwm_probe,
|
.probe = mxs_pwm_probe,
|
||||||
.remove = mxs_pwm_remove,
|
|
||||||
};
|
};
|
||||||
module_platform_driver(mxs_pwm_driver);
|
module_platform_driver(mxs_pwm_driver);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue