summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2014-06-25 18:18:18 +0900
committerLee Jones <lee.jones@linaro.org>2014-07-18 08:40:06 +0100
commitff9c5422d8ebae60bafedf8608ec54d4d87a6bc0 (patch)
treec3a3805c76d181b9a5a32fd4be75450c732dfaae /drivers/video
parent1e3b09701223afdff3b0353f87b566e7848bb24a (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>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/backlight/pwm_bl.c7
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;
}
/*