diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-07-13 17:51:42 +0200 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2023-07-28 09:46:22 +0200 |
commit | 8c89fd866ad221af037ef0ec3d60b83d0b859c65 (patch) | |
tree | 5846812afb163ac82d216fd9b6d4a1526dd0d236 /drivers/pwm | |
parent | e9c2f69aac05919a4f2bf72a7b53c43ac3f4c410 (diff) | |
download | linux-8c89fd866ad221af037ef0ec3d60b83d0b859c65.tar.gz linux-8c89fd866ad221af037ef0ec3d60b83d0b859c65.tar.bz2 linux-8c89fd866ad221af037ef0ec3d60b83d0b859c65.zip |
pwm: stm32: Simplify using devm_pwmchip_add()
This allows to drop the platform_driver's remove function.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r-- | drivers/pwm/pwm-stm32.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c index 687967d3265f..3d6be7749e23 100644 --- a/drivers/pwm/pwm-stm32.c +++ b/drivers/pwm/pwm-stm32.c @@ -637,7 +637,7 @@ static int stm32_pwm_probe(struct platform_device *pdev) priv->chip.ops = &stm32pwm_ops; priv->chip.npwm = stm32_pwm_detect_channels(priv); - ret = pwmchip_add(&priv->chip); + ret = devm_pwmchip_add(dev, &priv->chip); if (ret < 0) return ret; @@ -646,13 +646,6 @@ static int stm32_pwm_probe(struct platform_device *pdev) return 0; } -static void stm32_pwm_remove(struct platform_device *pdev) -{ - struct stm32_pwm *priv = platform_get_drvdata(pdev); - - pwmchip_remove(&priv->chip); -} - static int __maybe_unused stm32_pwm_suspend(struct device *dev) { struct stm32_pwm *priv = dev_get_drvdata(dev); @@ -697,7 +690,6 @@ MODULE_DEVICE_TABLE(of, stm32_pwm_of_match); static struct platform_driver stm32_pwm_driver = { .probe = stm32_pwm_probe, - .remove_new = stm32_pwm_remove, .driver = { .name = "stm32-pwm", .of_match_table = stm32_pwm_of_match, |