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@xxxxxxxxxx> --- 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