提交 ff9c5422 编写于 作者: A Alexandre Courbot 提交者: Lee Jones

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: NAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 1e3b0970
......@@ -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;
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册