@@ -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",
},
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(-)