提交 66a03c4f 编写于 作者: U Uwe Kleine-König 提交者: Thierry Reding

pwm: crc: Simplify using devm_pwmchip_add()

With devm_pwmchip_add() we can drop pwmchip_remove() from the device
remove callback. The latter can then go away, too and as this is the
only user of platform_get_drvdata(), the respective call to
platform_set_drvdata() can go, too.
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NThierry Reding <thierry.reding@gmail.com>
上级 f7edeb40
...@@ -173,21 +173,11 @@ static int crystalcove_pwm_probe(struct platform_device *pdev) ...@@ -173,21 +173,11 @@ static int crystalcove_pwm_probe(struct platform_device *pdev)
/* get the PMIC regmap */ /* get the PMIC regmap */
pwm->regmap = pmic->regmap; pwm->regmap = pmic->regmap;
platform_set_drvdata(pdev, pwm); return devm_pwmchip_add(&pdev->dev, &pwm->chip);
return pwmchip_add(&pwm->chip);
}
static int crystalcove_pwm_remove(struct platform_device *pdev)
{
struct crystalcove_pwm *pwm = platform_get_drvdata(pdev);
return pwmchip_remove(&pwm->chip);
} }
static struct platform_driver crystalcove_pwm_driver = { static struct platform_driver crystalcove_pwm_driver = {
.probe = crystalcove_pwm_probe, .probe = crystalcove_pwm_probe,
.remove = crystalcove_pwm_remove,
.driver = { .driver = {
.name = "crystal_cove_pwm", .name = "crystal_cove_pwm",
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册