summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2012-07-11 11:50:32 +0200
committerBryan Wu <bryan.wu@canonical.com>2012-07-24 01:52:40 +0200
commit5ecf6e40bbb8649b8418c8038a2af1faefbc56e4 (patch)
tree0f18e577dfdb0a3179f46e4a4d37a4e9e213eba7
parentleds: convert Network Space v2 LED driver to devm_kzalloc() and cleanup error... (diff)
downloadlinux-5ecf6e40bbb8649b8418c8038a2af1faefbc56e4.tar.xz
linux-5ecf6e40bbb8649b8418c8038a2af1faefbc56e4.zip
leds/leds-s3c24xx: use devm_gpio_request
why? because if the led_classdev_register fails we wont do gpio free because using devm_ functions, there is no need for error paths Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
-rw-r--r--drivers/leds/leds-s3c24xx.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c
index e1206407616d..942f0ea18178 100644
--- a/drivers/leds/leds-s3c24xx.c
+++ b/drivers/leds/leds-s3c24xx.c
@@ -65,7 +65,6 @@ static int s3c24xx_led_remove(struct platform_device *dev)
struct s3c24xx_gpio_led *led = pdev_to_gpio(dev);
led_classdev_unregister(&led->cdev);
- gpio_free(led->pdata->gpio);
return 0;
}
@@ -92,7 +91,7 @@ static int s3c24xx_led_probe(struct platform_device *dev)
led->pdata = pdata;
- ret = gpio_request(pdata->gpio, "S3C24XX_LED");
+ ret = devm_gpio_request(&dev->dev, pdata->gpio, "S3C24XX_LED");
if (ret < 0)
return ret;