drm/panel: sitronix-st7789v: Add check for of_drm_get_panel_orientation
authorChen Ni <nichen@iscas.ac.cn>
Tue, 28 May 2024 03:08:32 +0000 (11:08 +0800)
committerNeil Armstrong <neil.armstrong@linaro.org>
Mon, 3 Jun 2024 08:46:36 +0000 (10:46 +0200)
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
drivers/gpu/drm/panel/panel-sitronix-st7789v.c

index e8f385b9c6182c5fb038a3804c7742b97e36897c..28bfc48a91272901862dcaa309f51da4697d0a4a 100644 (file)
@@ -643,7 +643,9 @@ static int st7789v_probe(struct spi_device *spi)
        if (ret)
                return dev_err_probe(dev, ret, "Failed to get backlight\n");
 
-       of_drm_get_panel_orientation(spi->dev.of_node, &ctx->orientation);
+       ret = of_drm_get_panel_orientation(spi->dev.of_node, &ctx->orientation);
+       if (ret)
+               return dev_err_probe(&spi->dev, ret, "Failed to get orientation\n");
 
        drm_panel_add(&ctx->panel);