* [PATCH] pwm: visconti: Simplify using devm_pwmchip_add()
@ 2021-09-13 6:15 zhaoxiao
2021-09-13 8:11 ` Uwe Kleine-König
0 siblings, 1 reply; 2+ messages in thread
From: zhaoxiao @ 2021-09-13 6:15 UTC (permalink / raw)
To: thierry.reding, lee.jones
Cc: u.kleine-koenig, linux-pwm, linux-kernel, linux-arm-kernel,
zhaoxiao
This allows to drop the platform_driver's remove function. This is the
only user of driver data so this can go away, too.
Signed-off-by: zhaoxiao <long870912@gmail.com>
---
drivers/pwm/pwm-visconti.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/pwm/pwm-visconti.c b/drivers/pwm/pwm-visconti.c
index af4e37d3e3a6..927c4cbb1daf 100644
--- a/drivers/pwm/pwm-visconti.c
+++ b/drivers/pwm/pwm-visconti.c
@@ -144,28 +144,17 @@ static int visconti_pwm_probe(struct platform_device *pdev)
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);
- platform_set_drvdata(pdev, priv);
-
priv->chip.dev = dev;
priv->chip.ops = &visconti_pwm_ops;
priv->chip.npwm = 4;
- ret = pwmchip_add(&priv->chip);
+ ret = devm_pwmchip_add(&pdev->dev, &priv->chip);
if (ret < 0)
return dev_err_probe(&pdev->dev, ret, "Cannot register visconti PWM\n");
return 0;
}
-static int visconti_pwm_remove(struct platform_device *pdev)
-{
- struct visconti_pwm_chip *priv = platform_get_drvdata(pdev);
-
- pwmchip_remove(&priv->chip);
-
- return 0;
-}
-
static const struct of_device_id visconti_pwm_of_match[] = {
{ .compatible = "toshiba,visconti-pwm", },
{ }
@@ -178,7 +167,6 @@ static struct platform_driver visconti_pwm_driver = {
.of_match_table = visconti_pwm_of_match,
},
.probe = visconti_pwm_probe,
- .remove = visconti_pwm_remove,
};
module_platform_driver(visconti_pwm_driver);
--
2.20.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pwm: visconti: Simplify using devm_pwmchip_add()
2021-09-13 6:15 [PATCH] pwm: visconti: Simplify using devm_pwmchip_add() zhaoxiao
@ 2021-09-13 8:11 ` Uwe Kleine-König
0 siblings, 0 replies; 2+ messages in thread
From: Uwe Kleine-König @ 2021-09-13 8:11 UTC (permalink / raw)
To: zhaoxiao
Cc: thierry.reding, lee.jones, linux-pwm, linux-kernel,
linux-arm-kernel, kernel
[-- Attachment #1.1: Type: text/plain, Size: 678 bytes --]
On Mon, Sep 13, 2021 at 02:15:53PM +0800, zhaoxiao wrote:
> This allows to drop the platform_driver's remove function. This is the
> only user of driver data so this can go away, too.
>
> Signed-off-by: zhaoxiao <long870912@gmail.com>
Oh, it seems I missed that one when I converted the PWM drivers to use
devm_pwmchip_add(). Probably because the driver is new and wasn't in my
tree when I started the conversion. Thanks
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-13 8:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-13 6:15 [PATCH] pwm: visconti: Simplify using devm_pwmchip_add() zhaoxiao
2021-09-13 8:11 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).