From: Alexandre Courbot Date: Wed, 25 Jun 2014 09:18:18 +0000 (+0900) Subject: backlight: pwm-backlight: Use devm_gpiod_get_optional() X-Git-Tag: firefly_0821_release~176^2~3452^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ff9c5422d8ebae60bafedf8608ec54d4d87a6bc0;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Lee Jones --- 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; } /*