Commit ef41af47 authored by Cai Huoqing's avatar Cai Huoqing Committed by Sam Ravnborg

drm/panel: ls037v7dw01: Make use of the helper function dev_err_probe()

When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
And using dev_err_probe() can reduce code size, the error value
gets printed.
Signed-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210916104612.11516-1-caihuoqing@baidu.com
parent a30fc787
...@@ -146,22 +146,19 @@ static int ls037v7dw01_probe(struct platform_device *pdev) ...@@ -146,22 +146,19 @@ static int ls037v7dw01_probe(struct platform_device *pdev)
lcd->pdev = pdev; lcd->pdev = pdev;
lcd->vdd = devm_regulator_get(&pdev->dev, "envdd"); lcd->vdd = devm_regulator_get(&pdev->dev, "envdd");
if (IS_ERR(lcd->vdd)) { if (IS_ERR(lcd->vdd))
dev_err(&pdev->dev, "failed to get regulator\n"); return dev_err_probe(&pdev->dev, PTR_ERR(lcd->vdd),
return PTR_ERR(lcd->vdd); "failed to get regulator\n");
}
lcd->ini_gpio = devm_gpiod_get(&pdev->dev, "enable", GPIOD_OUT_LOW); lcd->ini_gpio = devm_gpiod_get(&pdev->dev, "enable", GPIOD_OUT_LOW);
if (IS_ERR(lcd->ini_gpio)) { if (IS_ERR(lcd->ini_gpio))
dev_err(&pdev->dev, "failed to get enable gpio\n"); return dev_err_probe(&pdev->dev, PTR_ERR(lcd->ini_gpio),
return PTR_ERR(lcd->ini_gpio); "failed to get enable gpio\n");
}
lcd->resb_gpio = devm_gpiod_get(&pdev->dev, "reset", GPIOD_OUT_LOW); lcd->resb_gpio = devm_gpiod_get(&pdev->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(lcd->resb_gpio)) { if (IS_ERR(lcd->resb_gpio))
dev_err(&pdev->dev, "failed to get reset gpio\n"); return dev_err_probe(&pdev->dev, PTR_ERR(lcd->resb_gpio),
return PTR_ERR(lcd->resb_gpio); "failed to get reset gpio\n");
}
lcd->mo_gpio = devm_gpiod_get_index(&pdev->dev, "mode", 0, lcd->mo_gpio = devm_gpiod_get_index(&pdev->dev, "mode", 0,
GPIOD_OUT_LOW); GPIOD_OUT_LOW);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment