* [PATCH] drm/panel: sitronix-st7789v: Add check for of_drm_get_panel_orientation
@ 2024-05-28 3:08 Chen Ni
2024-05-28 8:50 ` Michael Riesch
2024-05-28 16:39 ` Jessica Zhang
0 siblings, 2 replies; 3+ messages in thread
From: Chen Ni @ 2024-05-28 3:08 UTC (permalink / raw)
To: neil.armstrong, quic_jesszhan, sam, maarten.lankhorst, mripard,
tzimmermann, airlied, daniel, sre, michael.riesch
Cc: dri-devel, linux-kernel, Chen Ni
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(-)
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/panel: sitronix-st7789v: Add check for of_drm_get_panel_orientation
2024-05-28 3:08 [PATCH] drm/panel: sitronix-st7789v: Add check for of_drm_get_panel_orientation Chen Ni
@ 2024-05-28 8:50 ` Michael Riesch
2024-05-28 16:39 ` Jessica Zhang
1 sibling, 0 replies; 3+ messages in thread
From: Michael Riesch @ 2024-05-28 8:50 UTC (permalink / raw)
To: Chen Ni, neil.armstrong, quic_jesszhan, sam, maarten.lankhorst,
mripard, tzimmermann, airlied, daniel, sre
Cc: dri-devel, linux-kernel
Hi Chen Ni,
On 5/28/24 05:08, 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>
> ---
> 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);
I was worried that this effectively makes "rotation" a required property
(although it is not marked required in the bindings documentation) but
it turns out that of_drm_get_panel_orientation handles a missing
"rotation" property gracefully.
Also, all other panel drivers I checked handle the
of_drm_get_panel_orientation call as you suggested. Nice to see this
becoming aligned.
Reviewed-by: Michael Riesch <michael.riesch@wolfvision.net>
Thanks and best regards,
Michael
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/panel: sitronix-st7789v: Add check for of_drm_get_panel_orientation
2024-05-28 3:08 [PATCH] drm/panel: sitronix-st7789v: Add check for of_drm_get_panel_orientation Chen Ni
2024-05-28 8:50 ` Michael Riesch
@ 2024-05-28 16:39 ` Jessica Zhang
1 sibling, 0 replies; 3+ messages in thread
From: Jessica Zhang @ 2024-05-28 16:39 UTC (permalink / raw)
To: Chen Ni, neil.armstrong, sam, maarten.lankhorst, mripard,
tzimmermann, airlied, daniel, sre, michael.riesch
Cc: dri-devel, linux-kernel
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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-28 16:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-28 3:08 [PATCH] drm/panel: sitronix-st7789v: Add check for of_drm_get_panel_orientation Chen Ni
2024-05-28 8:50 ` Michael Riesch
2024-05-28 16:39 ` Jessica Zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®