diff options
author | Fida Mohammad <fmthoker@gmail.com> | 2015-10-21 03:58:35 -0700 |
---|---|---|
committer | Jacek Anaszewski <j.anaszewski@samsung.com> | 2015-11-03 08:59:58 +0100 |
commit | e9aadb864f04f1f7c7f8713fead64a2370be940d (patch) | |
tree | 4f29c31a6fe05ed29559f5f2346803a8f7d94477 /drivers/leds | |
parent | 10238adb6f2bcc6c418188ef3425ea57297fa3a6 (diff) | |
download | op-kernel-dev-e9aadb864f04f1f7c7f8713fead64a2370be940d.zip op-kernel-dev-e9aadb864f04f1f7c7f8713fead64a2370be940d.tar.gz |
leds: leds-wrap.c: Use devm_led_classdev_register
Use of resource managed function devm_led_classdev_register to
make initialization path simpler. Also removed redundant remove
function.
Signed-off-by: Fida Mohammad <fmthoker@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-wrap.c | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/drivers/leds/leds-wrap.c b/drivers/leds/leds-wrap.c index 1ba3def..473fb6b 100644 --- a/drivers/leds/leds-wrap.c +++ b/drivers/leds/leds-wrap.c @@ -76,39 +76,19 @@ static int wrap_led_probe(struct platform_device *pdev) { int ret; - ret = led_classdev_register(&pdev->dev, &wrap_power_led); + ret = devm_led_classdev_register(&pdev->dev, &wrap_power_led); if (ret < 0) return ret; - ret = led_classdev_register(&pdev->dev, &wrap_error_led); + ret = devm_led_classdev_register(&pdev->dev, &wrap_error_led); if (ret < 0) - goto err1; - - ret = led_classdev_register(&pdev->dev, &wrap_extra_led); - if (ret < 0) - goto err2; - - return ret; - -err2: - led_classdev_unregister(&wrap_error_led); -err1: - led_classdev_unregister(&wrap_power_led); - - return ret; -} + return ret; -static int wrap_led_remove(struct platform_device *pdev) -{ - led_classdev_unregister(&wrap_power_led); - led_classdev_unregister(&wrap_error_led); - led_classdev_unregister(&wrap_extra_led); - return 0; + return devm_led_classdev_register(&pdev->dev, &wrap_extra_led); } static struct platform_driver wrap_led_driver = { .probe = wrap_led_probe, - .remove = wrap_led_remove, .driver = { .name = DRVNAME, }, |