[PATCH v2 4/7] backlight: as3711_bl: Handle deferred probe

From: Krzysztof Kozlowski
Date: Tue Mar 05 2024 - 03:13:20 EST


Don't pollute dmesg on deferred probe and simplify the code with
dev_err_probe().

Reviewed-by: Daniel Thompson <daniel.thompson@xxxxxxxxxx>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
---
drivers/video/backlight/as3711_bl.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/as3711_bl.c b/drivers/video/backlight/as3711_bl.c
index 28437c2da0f5..e6f66bb35ef5 100644
--- a/drivers/video/backlight/as3711_bl.c
+++ b/drivers/video/backlight/as3711_bl.c
@@ -383,10 +383,8 @@ static int as3711_backlight_probe(struct platform_device *pdev)

if (pdev->dev.parent->of_node) {
ret = as3711_backlight_parse_dt(&pdev->dev);
- if (ret < 0) {
- dev_err(&pdev->dev, "DT parsing failed: %d\n", ret);
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(&pdev->dev, ret, "DT parsing failed\n");
}

if (!pdata->su1_fb && !pdata->su2_fb) {

--
2.34.1