diff mbox series

pwm: meson: Simplify using devm_pwmchip_add

Message ID 20210510171046.984246-1-u.kleine-koenig@pengutronix.de (mailing list archive)
State Superseded
Headers show
Series pwm: meson: Simplify using devm_pwmchip_add | expand

Commit Message

Uwe Kleine-König May 10, 2021, 5:10 p.m. UTC
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

this obviously depends on https://lore.kernel.org/r/20210407080155.55004-2-u.kleine-koenig@pengutronix.de

Best regards
Uwe

 drivers/pwm/pwm-meson.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)


base-commit: 6efb943b8616ec53a5e444193dccf1af9ad627b5
prerequisite-patch-id: fa39cd0c852d109ed957dc44dca5bdcf5dff0685

Comments

Romain Perier May 10, 2021, 6:42 p.m. UTC | #1
Hi,

The "struct device *" as first argument is missing, nop ?

Regards,
Romain


Le lun. 10 mai 2021 à 19:11, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> a écrit :
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
>
> this obviously depends on https://lore.kernel.org/r/20210407080155.55004-2-u.kleine-koenig@pengutronix.de
>
> Best regards
> Uwe
>
>  drivers/pwm/pwm-meson.c | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
> index 9eb060613cb4..d9de4562e003 100644
> --- a/drivers/pwm/pwm-meson.c
> +++ b/drivers/pwm/pwm-meson.c
> @@ -560,31 +560,21 @@ static int meson_pwm_probe(struct platform_device *pdev)
>         if (err < 0)
>                 return err;
>
> -       err = pwmchip_add(&meson->chip);
> +       err = devm_pwmchip_add(&meson->chip);
>         if (err < 0) {
>                 dev_err(&pdev->dev, "failed to register PWM chip: %d\n", err);
>                 return err;
>         }
>
> -       platform_set_drvdata(pdev, meson);
> -
>         return 0;
>  }
>
> -static int meson_pwm_remove(struct platform_device *pdev)
> -{
> -       struct meson_pwm *meson = platform_get_drvdata(pdev);
> -
> -       return pwmchip_remove(&meson->chip);
> -}
> -
>  static struct platform_driver meson_pwm_driver = {
>         .driver = {
>                 .name = "meson-pwm",
>                 .of_match_table = meson_pwm_matches,
>         },
>         .probe = meson_pwm_probe,
> -       .remove = meson_pwm_remove,
>  };
>  module_platform_driver(meson_pwm_driver);
>
>
> base-commit: 6efb943b8616ec53a5e444193dccf1af9ad627b5
> prerequisite-patch-id: fa39cd0c852d109ed957dc44dca5bdcf5dff0685
> --
> 2.30.2
>
>
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
index 9eb060613cb4..d9de4562e003 100644
--- a/drivers/pwm/pwm-meson.c
+++ b/drivers/pwm/pwm-meson.c
@@ -560,31 +560,21 @@  static int meson_pwm_probe(struct platform_device *pdev)
 	if (err < 0)
 		return err;
 
-	err = pwmchip_add(&meson->chip);
+	err = devm_pwmchip_add(&meson->chip);
 	if (err < 0) {
 		dev_err(&pdev->dev, "failed to register PWM chip: %d\n", err);
 		return err;
 	}
 
-	platform_set_drvdata(pdev, meson);
-
 	return 0;
 }
 
-static int meson_pwm_remove(struct platform_device *pdev)
-{
-	struct meson_pwm *meson = platform_get_drvdata(pdev);
-
-	return pwmchip_remove(&meson->chip);
-}
-
 static struct platform_driver meson_pwm_driver = {
 	.driver = {
 		.name = "meson-pwm",
 		.of_match_table = meson_pwm_matches,
 	},
 	.probe = meson_pwm_probe,
-	.remove = meson_pwm_remove,
 };
 module_platform_driver(meson_pwm_driver);