Thread (2 messages) 2 messages, 1 author, 2021-06-05

Re: [PATCH -next] leds: wm831x-status: use devm_led_classdev_register()

From: Yang Yingliang <hidden>
Date: 2021-06-05 07:07:26
Also in: lkml

This patch is wrong, ignore it.

On 2021/6/5 11:22, Yang Yingliang wrote:
quoted hunk ↗ jump to hunk
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 <redacted>
---
  drivers/leds/leds-wm831x-status.c | 12 +-----------
  1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/leds/leds-wm831x-status.c b/drivers/leds/leds-wm831x-status.c
index c48b80574f02..8ccd8b472572 100644
--- a/drivers/leds/leds-wm831x-status.c
+++ b/drivers/leds/leds-wm831x-status.c
@@ -269,7 +269,7 @@ static int wm831x_status_probe(struct platform_device *pdev)
  	drvdata->cdev.blink_set = wm831x_status_blink_set;
  	drvdata->cdev.groups = wm831x_status_groups;
  
-	ret = led_classdev_register(wm831x->dev, &drvdata->cdev);
+	ret = devm_led_classdev_register(wm831x->dev, &drvdata->cdev);
  	if (ret < 0) {
  		dev_err(&pdev->dev, "Failed to register LED: %d\n", ret);
  		return ret;
@@ -280,21 +280,11 @@ static int wm831x_status_probe(struct platform_device *pdev)
  	return 0;
  }
  
-static int wm831x_status_remove(struct platform_device *pdev)
-{
-	struct wm831x_status *drvdata = platform_get_drvdata(pdev);
-
-	led_classdev_unregister(&drvdata->cdev);
-
-	return 0;
-}
-
  static struct platform_driver wm831x_status_driver = {
  	.driver = {
  		   .name = "wm831x-status",
  		   },
  	.probe = wm831x_status_probe,
-	.remove = wm831x_status_remove,
  };
  
  module_platform_driver(wm831x_status_driver);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help