diff mbox series

[-next] leds: rb532: use devm_led_classdev_register()

Message ID 20210605064856.1863785-1-yangyingliang@huawei.com
State New
Headers show
Series [-next] leds: rb532: use devm_led_classdev_register() | expand

Commit Message

Yang Yingliang June 5, 2021, 6:48 a.m. UTC
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 mbox series

Patch

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",
 	},