summaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-crc.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2021-05-25 22:31:56 +0200
committerThierry Reding <thierry.reding@gmail.com>2021-06-28 13:25:04 +0200
commit66a03c4fd9e95e192c574811a1f4ea8f62992358 (patch)
tree259235b599c4504f9296d0036ac45d1c18b6e246 /drivers/pwm/pwm-crc.c
parentpwm: imx1: Simplify using devm_pwmchip_add() (diff)
downloadlinux-66a03c4fd9e95e192c574811a1f4ea8f62992358.tar.xz
linux-66a03c4fd9e95e192c574811a1f4ea8f62992358.zip
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: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-crc.c')
-rw-r--r--drivers/pwm/pwm-crc.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/pwm/pwm-crc.c b/drivers/pwm/pwm-crc.c
index 02522a9a3073..7b357d1cf642 100644
--- a/drivers/pwm/pwm-crc.c
+++ b/drivers/pwm/pwm-crc.c
@@ -173,21 +173,11 @@ static int crystalcove_pwm_probe(struct platform_device *pdev)
/* get the PMIC regmap */
pwm->regmap = pmic->regmap;
- platform_set_drvdata(pdev, pwm);
-
- 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);
+ return devm_pwmchip_add(&pdev->dev, &pwm->chip);
}
static struct platform_driver crystalcove_pwm_driver = {
.probe = crystalcove_pwm_probe,
- .remove = crystalcove_pwm_remove,
.driver = {
.name = "crystal_cove_pwm",
},