Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff9c5422 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Lee Jones
Browse files

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: default avatarAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 1e3b0970
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -239,12 +239,9 @@ 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;
	}