diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2014-06-25 18:18:18 +0900 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-07-18 08:40:06 +0100 |
commit | ff9c5422d8ebae60bafedf8608ec54d4d87a6bc0 (patch) | |
tree | c3a3805c76d181b9a5a32fd4be75450c732dfaae /drivers/video | |
parent | 1e3b09701223afdff3b0353f87b566e7848bb24a (diff) | |
download | linux-ff9c5422d8ebae60bafedf8608ec54d4d87a6bc0.tar.gz linux-ff9c5422d8ebae60bafedf8608ec54d4d87a6bc0.tar.xz |
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>
Diffstat (limited to 'drivers/video')
-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) pb->dev = &pdev->dev; pb->enabled = false; - pb->enable_gpio = devm_gpiod_get(&pdev->dev, "enable"); + pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable"); if (IS_ERR(pb->enable_gpio)) { ret = PTR_ERR(pb->enable_gpio); - if (ret == -ENOENT) - pb->enable_gpio = NULL; - else - goto err_alloc; + goto err_alloc; } /* |