提交 5ecf6e40 编写于 作者: D Devendra Naga 提交者: Bryan Wu

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: NDevendra Naga <devendra.aaru@gmail.com>
Signed-off-by: NBryan Wu <bryan.wu@canonical.com>
上级 a209f766
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册