staging: nvec: replace led_classdev_register
authorHari Prasath Gujulan Elango <hgujulan@visteon.com>
Thu, 21 Jan 2016 10:23:46 +0000 (10:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Feb 2016 04:00:04 +0000 (20:00 -0800)
Replace the led_classdev_register() with the platform managed version
devm_led_classdev_register() & henceforth remove the redundant
nvec_paz00_remove() function.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/nvec/nvec_paz00.c

index 68146bfee2b34ec01d0dfb88db1bd44fa6a85eab..cddbfd2bcf11c7b7b42658303aaee83b1e2d202b 100644 (file)
@@ -63,7 +63,7 @@ static int nvec_paz00_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, led);
 
-       ret = led_classdev_register(&pdev->dev, &led->cdev);
+       ret = devm_led_classdev_register(&pdev->dev, &led->cdev);
        if (ret < 0)
                return ret;
 
@@ -73,18 +73,8 @@ static int nvec_paz00_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int nvec_paz00_remove(struct platform_device *pdev)
-{
-       struct nvec_led *led = platform_get_drvdata(pdev);
-
-       led_classdev_unregister(&led->cdev);
-
-       return 0;
-}
-
 static struct platform_driver nvec_paz00_driver = {
        .probe  = nvec_paz00_probe,
-       .remove = nvec_paz00_remove,
        .driver = {
                .name  = "nvec-paz00",
        },