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

pwm: raspberrypi-poe: 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 97f29035
...@@ -166,8 +166,6 @@ static int raspberrypi_pwm_probe(struct platform_device *pdev) ...@@ -166,8 +166,6 @@ static int raspberrypi_pwm_probe(struct platform_device *pdev)
rpipwm->chip.base = -1; rpipwm->chip.base = -1;
rpipwm->chip.npwm = RASPBERRYPI_FIRMWARE_PWM_NUM; rpipwm->chip.npwm = RASPBERRYPI_FIRMWARE_PWM_NUM;
platform_set_drvdata(pdev, rpipwm);
ret = raspberrypi_pwm_get_property(rpipwm->firmware, RPI_PWM_CUR_DUTY_REG, ret = raspberrypi_pwm_get_property(rpipwm->firmware, RPI_PWM_CUR_DUTY_REG,
&rpipwm->duty_cycle); &rpipwm->duty_cycle);
if (ret) { if (ret) {
...@@ -175,14 +173,7 @@ static int raspberrypi_pwm_probe(struct platform_device *pdev) ...@@ -175,14 +173,7 @@ static int raspberrypi_pwm_probe(struct platform_device *pdev)
return ret; return ret;
} }
return pwmchip_add(&rpipwm->chip); return devm_pwmchip_add(dev, &rpipwm->chip);
}
static int raspberrypi_pwm_remove(struct platform_device *pdev)
{
struct raspberrypi_pwm *rpipwm = platform_get_drvdata(pdev);
return pwmchip_remove(&rpipwm->chip);
} }
static const struct of_device_id raspberrypi_pwm_of_match[] = { static const struct of_device_id raspberrypi_pwm_of_match[] = {
...@@ -197,7 +188,6 @@ static struct platform_driver raspberrypi_pwm_driver = { ...@@ -197,7 +188,6 @@ static struct platform_driver raspberrypi_pwm_driver = {
.of_match_table = raspberrypi_pwm_of_match, .of_match_table = raspberrypi_pwm_of_match,
}, },
.probe = raspberrypi_pwm_probe, .probe = raspberrypi_pwm_probe,
.remove = raspberrypi_pwm_remove,
}; };
module_platform_driver(raspberrypi_pwm_driver); module_platform_driver(raspberrypi_pwm_driver);
......
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