pwm: stm32-lp: 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>
This commit is contained in:
parent
02dd2e417e
commit
8614e21008
|
@ -209,7 +209,7 @@ static int stm32_pwm_lp_probe(struct platform_device *pdev)
|
||||||
priv->chip.ops = &stm32_pwm_lp_ops;
|
priv->chip.ops = &stm32_pwm_lp_ops;
|
||||||
priv->chip.npwm = 1;
|
priv->chip.npwm = 1;
|
||||||
|
|
||||||
ret = pwmchip_add(&priv->chip);
|
ret = devm_pwmchip_add(&pdev->dev, &priv->chip);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -218,13 +218,6 @@ static int stm32_pwm_lp_probe(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int stm32_pwm_lp_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct stm32_pwm_lp *priv = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
return pwmchip_remove(&priv->chip);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int __maybe_unused stm32_pwm_lp_suspend(struct device *dev)
|
static int __maybe_unused stm32_pwm_lp_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct stm32_pwm_lp *priv = dev_get_drvdata(dev);
|
struct stm32_pwm_lp *priv = dev_get_drvdata(dev);
|
||||||
|
@ -256,7 +249,6 @@ MODULE_DEVICE_TABLE(of, stm32_pwm_lp_of_match);
|
||||||
|
|
||||||
static struct platform_driver stm32_pwm_lp_driver = {
|
static struct platform_driver stm32_pwm_lp_driver = {
|
||||||
.probe = stm32_pwm_lp_probe,
|
.probe = stm32_pwm_lp_probe,
|
||||||
.remove = stm32_pwm_lp_remove,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "stm32-pwm-lp",
|
.name = "stm32-pwm-lp",
|
||||||
.of_match_table = of_match_ptr(stm32_pwm_lp_of_match),
|
.of_match_table = of_match_ptr(stm32_pwm_lp_of_match),
|
||||||
|
|
Loading…
Reference in New Issue