diff mbox series

[1/1] backlight: pwm_bl: Use dev_err_probe

Message ID 20231116075017.939926-1-alexander.stein@ew.tq-group.com
State New
Headers show
Series [1/1] backlight: pwm_bl: Use dev_err_probe | expand

Commit Message

Alexander Stein Nov. 16, 2023, 7:50 a.m. UTC
Let dev_err_probe handle the -EPROBE_DEFER case and also add an entry to
/sys/kernel/debug/devices_deferred when deferred.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 drivers/video/backlight/pwm_bl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 289bd9ce4d36d..3825c2b67c53b 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -509,8 +509,7 @@  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)
-			dev_err(&pdev->dev, "unable to request PWM\n");
+		dev_err_probe(&pdev->dev, ret, "unable to request PWM\n");
 		goto err_alloc;
 	}