Commit a64a5853 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Thierry Reding

pwm: tiecap: Simplify using devm_pwmchip_add()

With devm_pwmchip_add() there is no need to explicitly call
pwmchip_remove(), so this call can be dropped from the remove callback.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 8614e210
...@@ -253,7 +253,7 @@ static int ecap_pwm_probe(struct platform_device *pdev) ...@@ -253,7 +253,7 @@ static int ecap_pwm_probe(struct platform_device *pdev)
if (IS_ERR(pc->mmio_base)) if (IS_ERR(pc->mmio_base))
return PTR_ERR(pc->mmio_base); return PTR_ERR(pc->mmio_base);
ret = pwmchip_add(&pc->chip); ret = devm_pwmchip_add(&pdev->dev, &pc->chip);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret); dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
return ret; return ret;
...@@ -267,11 +267,9 @@ static int ecap_pwm_probe(struct platform_device *pdev) ...@@ -267,11 +267,9 @@ static int ecap_pwm_probe(struct platform_device *pdev)
static int ecap_pwm_remove(struct platform_device *pdev) static int ecap_pwm_remove(struct platform_device *pdev)
{ {
struct ecap_pwm_chip *pc = platform_get_drvdata(pdev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
return pwmchip_remove(&pc->chip); return 0;
} }
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment