linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/sun4i: Add error handling in sun4i_layer_init_one()
@ 2023-09-24  7:42 liuhaoran
  2023-09-24  9:09 ` kernel test robot
  2023-09-24 19:47 ` Jernej Škrabec
  0 siblings, 2 replies; 3+ messages in thread
From: liuhaoran @ 2023-09-24  7:42 UTC (permalink / raw)
  To: airlied
  Cc: daniel, jernej.skrabec, samuel, dri-devel, linux-arm-kernel,
	linux-sunxi, linux-kernel, liuhaoran

This patch adds error-handling for the drm_plane_create_alpha_property()
and drm_plane_create_zpos_property() inside the dw_hdmi_imx_probe().

Signed-off-by: liuhaoran <liuhaoran14@163.com>
---
 drivers/gpu/drm/sun4i/sun4i_layer.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
index 98f3176366c0..a3343afb7935 100644
--- a/drivers/gpu/drm/sun4i/sun4i_layer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
@@ -224,9 +224,22 @@ static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm,
 	drm_plane_helper_add(&layer->plane,
 			     &sun4i_backend_layer_helper_funcs);
 
-	drm_plane_create_alpha_property(&layer->plane);
-	drm_plane_create_zpos_property(&layer->plane, layer->id,
-				       0, SUN4I_BACKEND_NUM_LAYERS - 1);
+	ret = drm_plane_create_alpha_property(&layer->plane);
+
+	if (ret) {
+		dev_err(drm->dev, "Failed to install alpha property,
+			rc = %d\n", ret);
+		return ERR_PTR(ret);
+	}
+
+	ret = drm_plane_create_zpos_property(&layer->plane, layer->id, 0,
+					     SUN4I_BACKEND_NUM_LAYERS - 1);
+
+	if (ret) {
+		dev_err(drm->dev, "Failed to install zpos property,
+			rc = %d\n", ret);
+		return ERR_PTR(ret);
+	}
 
 	return layer;
 }
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-24 19:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-24  7:42 [PATCH] drm/sun4i: Add error handling in sun4i_layer_init_one() liuhaoran
2023-09-24  9:09 ` kernel test robot
2023-09-24 19:47 ` Jernej Škrabec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).