diff mbox series

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

Message ID 20240528030832.2529471-1-nichen@iscas.ac.cn (mailing list archive)
State New, archived
Headers show
Series drm/panel: sitronix-st7789v: Add check for of_drm_get_panel_orientation | expand

Commit Message

Chen Ni May 28, 2024, 3:08 a.m. UTC
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>
---
 drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Jessica Zhang May 28, 2024, 4:39 p.m. UTC | #1
On 5/27/2024 8:08 PM, Chen Ni wrote:
> 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>

Hi Chen Ni,

Acked-by: Jessica Zhang <quic_jesszhan@quicinc.com>

Thanks,

Jessica Zhang

> ---
>   drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
> index 88e80fe98112..8b15e225bf37 100644
> --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
> @@ -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);
>   
> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
index 88e80fe98112..8b15e225bf37 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
@@ -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);