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

Commit 68feaca0 authored by Nicolas Ferre's avatar Nicolas Ferre Committed by Lee Jones
Browse files

backlight: pwm: Handle EPROBE_DEFER while requesting the PWM



When trying to request the PWM device with devm_pwm_get(), the EPROBE_DEFER
flag is not handled properly. It can lead to the PWM not being found.

Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: default avatarThierry Reding <thierry.reding@gmail.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent b787f68c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -274,6 +274,10 @@ static int pwm_backlight_probe(struct platform_device *pdev)

	pb->pwm = devm_pwm_get(&pdev->dev, NULL);
	if (IS_ERR(pb->pwm)) {
		ret = PTR_ERR(pb->pwm);
		if (ret == -EPROBE_DEFER)
			goto err_alloc;

		dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n");
		pb->legacy = true;
		pb->pwm = pwm_request(data->pwm_id, "pwm-backlight");