Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/panel: ltk050h3146w: only print message when GPIO getting is not EPROBE_DEFER

devm_gpiod_get_optional may return EPROBE_DEFER in case the GPIO
controller isn't yet probed when the panel driver is being probed.

In that case, a spurious and confusing error message about not being
able to get the reset GPIO is printed even though later on the device
actually manages to get probed.

Use dev_err_probe instead so that the message is only printed when it
truly matters.

Cc: Quentin Schulz <foss+kernel@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240104-ltk-dev_err_probe-v1-1-8ef3c0b585d8@theobroma-systems.com

authored by

Quentin Schulz and committed by
Heiko Stuebner
65afd91e 52d11c86

+2 -4
+2 -4
drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
··· 646 646 return -EINVAL; 647 647 648 648 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); 649 - if (IS_ERR(ctx->reset_gpio)) { 650 - dev_err(dev, "cannot get reset gpio\n"); 651 - return PTR_ERR(ctx->reset_gpio); 652 - } 649 + if (IS_ERR(ctx->reset_gpio)) 650 + return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), "cannot get reset gpio\n"); 653 651 654 652 ctx->vci = devm_regulator_get(dev, "vci"); 655 653 if (IS_ERR(ctx->vci)) {