summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFida Mohammad <fmthoker@gmail.com>2015-10-16 14:33:03 -0700
committerJacek Anaszewski <j.anaszewski@samsung.com>2015-11-03 08:59:50 +0100
commitd43986143463690642bac8897196496d4c776269 (patch)
treec17e66dbd005675e283d71bb54e77fe3c58465b4 /drivers
parent707f33ed85ff423016674d27bb2e60fe8fa352ce (diff)
downloadlinux-d43986143463690642bac8897196496d4c776269.tar.bz2
leds: leds-locomo.c: Use devm_led_classdev_register
Use resource managed function devm_led_classdev_register to make initialisation path simpler. Also removed redundant led_classdev_unregister function. Signed-off-by: Fida Mohammad <fmthoker@gmail.com> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/leds/leds-locomo.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/leds/leds-locomo.c b/drivers/leds/leds-locomo.c
index 80ba048889d6..24c4b53a6b93 100644
--- a/drivers/leds/leds-locomo.c
+++ b/drivers/leds/leds-locomo.c
@@ -59,23 +59,13 @@ static int locomoled_probe(struct locomo_dev *ldev)
{
int ret;
- ret = led_classdev_register(&ldev->dev, &locomo_led0);
+ ret = devm_led_classdev_register(&ldev->dev, &locomo_led0);
if (ret < 0)
return ret;
- ret = led_classdev_register(&ldev->dev, &locomo_led1);
- if (ret < 0)
- led_classdev_unregister(&locomo_led0);
-
- return ret;
+ return devm_led_classdev_register(&ldev->dev, &locomo_led1);
}
-static int locomoled_remove(struct locomo_dev *dev)
-{
- led_classdev_unregister(&locomo_led0);
- led_classdev_unregister(&locomo_led1);
- return 0;
-}
static struct locomo_driver locomoled_driver = {
.drv = {
@@ -83,7 +73,6 @@ static struct locomo_driver locomoled_driver = {
},
.devid = LOCOMO_DEVID_LED,
.probe = locomoled_probe,
- .remove = locomoled_remove,
};
static int __init locomoled_init(void)