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

drm/panel: sitronix-st7789v: Add check for of_drm_get_panel_orientation

Add check for the return value of of_drm_get_panel_orientation() and
return the error if it fails in order to catch the error.

Fixes: b27c0f6d208d ("drm/panel: sitronix-st7789v: add panel orientation support")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Michael Riesch <michael.riesch@wolfvision.net>
Acked-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Link: https://lore.kernel.org/r/20240528030832.2529471-1-nichen@iscas.ac.cn
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240528030832.2529471-1-nichen@iscas.ac.cn

authored by

Chen Ni and committed by
Neil Armstrong
629f2b4e bb195358

+3 -1
+3 -1
drivers/gpu/drm/panel/panel-sitronix-st7789v.c
··· 643 643 if (ret) 644 644 return dev_err_probe(dev, ret, "Failed to get backlight\n"); 645 645 646 - of_drm_get_panel_orientation(spi->dev.of_node, &ctx->orientation); 646 + ret = of_drm_get_panel_orientation(spi->dev.of_node, &ctx->orientation); 647 + if (ret) 648 + return dev_err_probe(&spi->dev, ret, "Failed to get orientation\n"); 647 649 648 650 drm_panel_add(&ctx->panel); 649 651