Use devm_led_classdev_register() for led device registration and remove led_classdev_unregister() in .remove(). This is done by managed device framework. Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx> --- drivers/leds/leds-asic3.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/leds/leds-asic3.c b/drivers/leds/leds-asic3.c index 8cbc1b8bafa5..e01d33431633 100644 --- a/drivers/leds/leds-asic3.c +++ b/drivers/leds/leds-asic3.c @@ -110,7 +110,7 @@ static int asic3_led_probe(struct platform_device *pdev) led->cdev->blink_set = blink_set; led->cdev->default_trigger = led->default_trigger; - ret = led_classdev_register(&pdev->dev, led->cdev); + ret = devm_led_classdev_register(&pdev->dev, led->cdev); if (ret < 0) goto out; @@ -123,10 +123,6 @@ static int asic3_led_probe(struct platform_device *pdev) static int asic3_led_remove(struct platform_device *pdev) { - struct asic3_led *led = dev_get_platdata(&pdev->dev); - - led_classdev_unregister(led->cdev); - return mfd_cell_disable(pdev); } -- 2.25.1