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

pwm: pxa: 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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 9c3fac7a
...@@ -195,32 +195,21 @@ static int pwm_probe(struct platform_device *pdev) ...@@ -195,32 +195,21 @@ static int 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;
} }
platform_set_drvdata(pdev, pc);
return 0; return 0;
} }
static int pwm_remove(struct platform_device *pdev)
{
struct pxa_pwm_chip *pc;
pc = platform_get_drvdata(pdev);
return pwmchip_remove(&pc->chip);
}
static struct platform_driver pwm_driver = { static struct platform_driver pwm_driver = {
.driver = { .driver = {
.name = "pxa25x-pwm", .name = "pxa25x-pwm",
.of_match_table = pwm_of_match, .of_match_table = pwm_of_match,
}, },
.probe = pwm_probe, .probe = pwm_probe,
.remove = pwm_remove,
.id_table = pwm_id_table, .id_table = pwm_id_table,
}; };
......
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