Skip to content

Commit 8c89fd8

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
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>
1 parent e9c2f69 commit 8c89fd8

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

drivers/pwm/pwm-stm32.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ static int stm32_pwm_probe(struct platform_device *pdev)
637637
priv->chip.ops = &stm32pwm_ops;
638638
priv->chip.npwm = stm32_pwm_detect_channels(priv);
639639

640-
ret = pwmchip_add(&priv->chip);
640+
ret = devm_pwmchip_add(dev, &priv->chip);
641641
if (ret < 0)
642642
return ret;
643643

@@ -646,13 +646,6 @@ static int stm32_pwm_probe(struct platform_device *pdev)
646646
return 0;
647647
}
648648

649-
static void stm32_pwm_remove(struct platform_device *pdev)
650-
{
651-
struct stm32_pwm *priv = platform_get_drvdata(pdev);
652-
653-
pwmchip_remove(&priv->chip);
654-
}
655-
656649
static int __maybe_unused stm32_pwm_suspend(struct device *dev)
657650
{
658651
struct stm32_pwm *priv = dev_get_drvdata(dev);
@@ -697,7 +690,6 @@ MODULE_DEVICE_TABLE(of, stm32_pwm_of_match);
697690

698691
static struct platform_driver stm32_pwm_driver = {
699692
.probe = stm32_pwm_probe,
700-
.remove_new = stm32_pwm_remove,
701693
.driver = {
702694
.name = "stm32-pwm",
703695
.of_match_table = stm32_pwm_of_match,

0 commit comments

Comments
 (0)