From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>, <linux-leds@vger.kernel.org>
Cc: <pavel@ucw.cz>
Subject: [PATCH -next] leds: rb532: use devm_led_classdev_register()
Date: Sat, 5 Jun 2021 14:48:56 +0800 [thread overview]
Message-ID: <20210605064856.1863785-1-yangyingliang@huawei.com> (raw)
Use devm_led_classdev_register() for led device registration and
get rid of .remove callback to remove led device. This is done by
managed device framework.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/leds/leds-rb532.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/leds/leds-rb532.c b/drivers/leds/leds-rb532.c
index b6447c1721b4..6d64ac9175b9 100644
--- a/drivers/leds/leds-rb532.c
+++ b/drivers/leds/leds-rb532.c
@@ -39,18 +39,11 @@ static struct led_classdev rb532_uled = {
static int rb532_led_probe(struct platform_device *pdev)
{
- return led_classdev_register(&pdev->dev, &rb532_uled);
-}
-
-static int rb532_led_remove(struct platform_device *pdev)
-{
- led_classdev_unregister(&rb532_uled);
- return 0;
+ return devm_led_classdev_register(&pdev->dev, &rb532_uled);
}
static struct platform_driver rb532_led_driver = {
.probe = rb532_led_probe,
- .remove = rb532_led_remove,
.driver = {
.name = "rb532-led",
},
--
2.25.1
reply other threads:[~2021-06-05 6:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210605064856.1863785-1-yangyingliang@huawei.com \
--to=yangyingliang@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
/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).