From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: kernel@pengutronix.de, Pavel Machek <pavel@ucw.cz>,
Lee Jones <lee@kernel.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Anjelique Melendez <quic_amelende@quicinc.com>,
Lu Hongfei <luhongfei@vivo.com>,
Bjorn Andersson <quic_bjorande@quicinc.com>,
Luca Weiss <luca@z3ntu.xyz>,
linux-leds@vger.kernel.org
Subject: [PATCH v4 003/115] leds: qcom-lpg: Use devm_pwmchip_add() simplifying driver removal
Date: Wed, 6 Dec 2023 12:43:17 +0100 [thread overview]
Message-ID: <631d24f0edaa7ac8ebeb22bb66260db8d8823aff.1701860672.git.u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <cover.1701860672.git.u.kleine-koenig@pengutronix.de>
With pwmchip_remove() being automatically called after switching to
devm_pwmchip_add() the remove function can be dropped completely. Yay!
With lpg_remove() gone there is no user of the platform device's drvdata
left, so platform_set_drvdata() can be dropped from .probe(), too.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Note this patch was already sent out individually, find it at
https://lore.kernel.org/linux-leds/20231126095230.683204-2-u.kleine-koenig@pengutronix.de/
drivers/leds/rgb/leds-qcom-lpg.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c
index 68d82a682bf6..f5805fd0eb21 100644
--- a/drivers/leds/rgb/leds-qcom-lpg.c
+++ b/drivers/leds/rgb/leds-qcom-lpg.c
@@ -1095,7 +1095,7 @@ static int lpg_add_pwm(struct lpg *lpg)
lpg->pwm.npwm = lpg->num_channels;
lpg->pwm.ops = &lpg_pwm_ops;
- ret = pwmchip_add(&lpg->pwm);
+ ret = devm_pwmchip_add(lpg->dev, &lpg->pwm);
if (ret)
dev_err(lpg->dev, "failed to add PWM chip: ret %d\n", ret);
@@ -1324,8 +1324,6 @@ static int lpg_probe(struct platform_device *pdev)
if (!lpg->data)
return -EINVAL;
- platform_set_drvdata(pdev, lpg);
-
lpg->dev = &pdev->dev;
mutex_init(&lpg->lock);
@@ -1363,13 +1361,6 @@ static int lpg_probe(struct platform_device *pdev)
return lpg_add_pwm(lpg);
}
-static void lpg_remove(struct platform_device *pdev)
-{
- struct lpg *lpg = platform_get_drvdata(pdev);
-
- pwmchip_remove(&lpg->pwm);
-}
-
static const struct lpg_data pm8916_pwm_data = {
.num_channels = 1,
.channels = (const struct lpg_channel_data[]) {
@@ -1529,7 +1520,6 @@ MODULE_DEVICE_TABLE(of, lpg_of_table);
static struct platform_driver lpg_driver = {
.probe = lpg_probe,
- .remove_new = lpg_remove,
.driver = {
.name = "qcom-spmi-lpg",
.of_match_table = lpg_of_table,
--
2.42.0
next prev parent reply other threads:[~2023-12-06 11:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-06 11:43 [PATCH v4 000/115] pwm: Fix lifetime issues for pwm_chips Uwe Kleine-König
2023-12-06 11:43 ` Uwe Kleine-König [this message]
2023-12-07 17:06 ` [PATCH v4 003/115] leds: qcom-lpg: Use devm_pwmchip_add() simplifying driver removal Lee Jones
2023-12-07 17:58 ` Uwe Kleine-König
2023-12-13 15:48 ` Lee Jones
2023-12-13 15:51 ` (subset) " Lee Jones
2023-12-06 11:43 ` [PATCH v4 004/115] leds: qcom-lpg: Consistenly use dev_err_probe() in .probe()'s error path Uwe Kleine-König
2023-12-07 17:06 ` Lee Jones
2023-12-13 15:50 ` Lee Jones
2023-12-06 11:43 ` [PATCH v4 005/115] leds: qcom-lpg: Introduce a wrapper for getting driver data from a pwm chip Uwe Kleine-König
2023-12-07 17:05 ` Lee Jones
2023-12-13 15:51 ` (subset) " Lee Jones
2023-12-06 11:45 ` [PATCH v4 108/115] leds: qcom-lpg: Make use of devm_pwmchip_alloc() function Uwe Kleine-König
2023-12-07 17:05 ` Lee Jones
2023-12-08 15:41 ` [PATCH v4 000/115] pwm: Fix lifetime issues for pwm_chips Thierry Reding
2023-12-08 18:50 ` Uwe Kleine-König
2023-12-11 11:33 ` Thierry Reding
2023-12-11 12:18 ` Uwe Kleine-König
2023-12-12 21:05 ` Uwe Kleine-König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=631d24f0edaa7ac8ebeb22bb66260db8d8823aff.1701860672.git.u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=jernej.skrabec@gmail.com \
--cc=kernel@pengutronix.de \
--cc=lee@kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=luca@z3ntu.xyz \
--cc=luhongfei@vivo.com \
--cc=pavel@ucw.cz \
--cc=quic_amelende@quicinc.com \
--cc=quic_bjorande@quicinc.com \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).