Skip to contentSkip to conversation

backlight: pwm_bl: Switch to use dev_err_probe() helper

PATCH In review Yang Yingliang 2 participants 4 messages Sep 26, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 backlight: pwm_bl: Switch to use dev_err_probe() helper

In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path.

---
 drivers/video/backlight/pwm_bl.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/video/backlight/pwm_bl.c +2 -3
index c0523a0269ee..ae858e3bd38f 100644
@@ -513,9 +513,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 	}
 
 	if (IS_ERR(pb->pwm)) {
-		ret = PTR_ERR(pb->pwm);
-		if (ret != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "unable to request PWM\n");
+		ret = dev_err_probe(&pdev->dev, PTR_ERR(pb->pwm),
+				    "unable to request PWM\n");
 		goto err_alloc;
 	}
 
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Yang Yingliang

In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path.

I'd prefer to have received these patches as a patchset rather than individual patches... but it is a good change so:

Daniel.

#2 lore raw
Quoted 10 lines · Daniel Thompson
Quoted 4 lines · Yang Yingliang

In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path.

I'd prefer to have received these patches as a patchset rather than individual patches... but it is a good change so:

Oops. My last mail neglected to mention that you did not sign off your changes (meaning we cannot accept them). When you re-send this please add a SoB and combine with the other similar patches.

Daniel.

#3 lore raw

Hi,

Quoted 6 lines · Daniel Thompson
Quoted 5 lines · Daniel Thompson
Quoted 4 lines · Yang Yingliang

In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path.

Quoted 7 lines
Quoted 4 lines

I'd prefer to have received these patches as a patchset rather than individual patches... but it is a good change so:

Oops. My last mail neglected to mention that you did not sign off your changes (meaning we cannot accept them). When you re-send this please add a SoB and combine with the other similar patches.

I missed -s when doing format-patch, I will add my SoB and your reivew tag in v2.

Thanks,
Yang

Quoted 4 lines

Daniel.
.