diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2014-06-25 05:18:18 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-07-18 03:40:06 -0400 |
commit | ff9c5422d8ebae60bafedf8608ec54d4d87a6bc0 (patch) | |
tree | c3a3805c76d181b9a5a32fd4be75450c732dfaae | |
parent | 1e3b09701223afdff3b0353f87b566e7848bb24a (diff) |
backlight: pwm-backlight: Use devm_gpiod_get_optional()
Make use of the new devm_gpiod_get_optional() to simplify the probe
code.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r-- | drivers/video/backlight/pwm_bl.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index c9c8496369b3..d7a3d13e72ec 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c | |||
@@ -239,13 +239,10 @@ static int pwm_backlight_probe(struct platform_device *pdev) | |||
239 | pb->dev = &pdev->dev; | 239 | pb->dev = &pdev->dev; |
240 | pb->enabled = false; | 240 | pb->enabled = false; |
241 | 241 | ||
242 | pb->enable_gpio = devm_gpiod_get(&pdev->dev, "enable"); | 242 | pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable"); |
243 | if (IS_ERR(pb->enable_gpio)) { | 243 | if (IS_ERR(pb->enable_gpio)) { |
244 | ret = PTR_ERR(pb->enable_gpio); | 244 | ret = PTR_ERR(pb->enable_gpio); |
245 | if (ret == -ENOENT) | 245 | goto err_alloc; |
246 | pb->enable_gpio = NULL; | ||
247 | else | ||
248 | goto err_alloc; | ||
249 | } | 246 | } |
250 | 247 | ||
251 | /* | 248 | /* |