diff options
author | Muhammad Falak R Wani <falakreyaz@gmail.com> | 2015-09-05 22:53:37 +0300 |
---|---|---|
committer | Jacek Anaszewski <j.anaszewski@samsung.com> | 2015-11-03 10:59:11 +0300 |
commit | c0fc68ba97b0f96fa4aaa6010ead6b77d3ffc3dd (patch) | |
tree | 74cd1be90c4c548be10793fe35fb16854d969cdd /drivers/leds/leds-hp6xx.c | |
parent | aa4e2524955971730ff845c0589f2f8f441ad610 (diff) | |
download | linux-c0fc68ba97b0f96fa4aaa6010ead6b77d3ffc3dd.tar.xz |
leds: leds-hp6xx: Use devm_led_classdev_register
Use resource-managed function devm_led_classdev_register
instead of led_classdev_register to simplify error path.
An unnecessary check of ret is replaced with a direct return
Also, remove redundant hp6xxled_remove.
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Diffstat (limited to 'drivers/leds/leds-hp6xx.c')
-rw-r--r-- | drivers/leds/leds-hp6xx.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/leds/leds-hp6xx.c b/drivers/leds/leds-hp6xx.c index 0b84c0113126..a6b8db0e27f1 100644 --- a/drivers/leds/leds-hp6xx.c +++ b/drivers/leds/leds-hp6xx.c @@ -59,28 +59,15 @@ static int hp6xxled_probe(struct platform_device *pdev) { int ret; - ret = led_classdev_register(&pdev->dev, &hp6xx_red_led); + ret = devm_led_classdev_register(&pdev->dev, &hp6xx_red_led); if (ret < 0) return ret; - ret = led_classdev_register(&pdev->dev, &hp6xx_green_led); - if (ret < 0) - led_classdev_unregister(&hp6xx_red_led); - - return ret; -} - -static int hp6xxled_remove(struct platform_device *pdev) -{ - led_classdev_unregister(&hp6xx_red_led); - led_classdev_unregister(&hp6xx_green_led); - - return 0; + return devm_led_classdev_register(&pdev->dev, &hp6xx_green_led); } static struct platform_driver hp6xxled_driver = { .probe = hp6xxled_probe, - .remove = hp6xxled_remove, .driver = { .name = "hp6xx-led", }, |