Re: [PATCH 02/10] drm/panel/samsung-s6e63m0: Use refcounted allocation in place of devm_kzalloc()
From: Neil Armstrong
Date: Thu May 07 2026 - 11:35:24 EST
On 5/7/26 13:53, Albert Esteve wrote:
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Albert Esteve <aesteve@xxxxxxxxxx>
---
drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
index ea241c89593b6..997115b1e541d 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
@@ -677,9 +677,13 @@ int s6e63m0_probe(struct device *dev, void *trsp,
u32 max_brightness;
int ret;
- ctx = devm_kzalloc(dev, sizeof(struct s6e63m0), GFP_KERNEL);
- if (!ctx)
- return -ENOMEM;
+ ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel,
+ &s6e63m0_drm_funcs,
+ dsi_mode ? DRM_MODE_CONNECTOR_DSI :
+ DRM_MODE_CONNECTOR_DPI);
+
+ if (IS_ERR(ctx))
+ return PTR_ERR(ctx);
ctx->transport_data = trsp;
ctx->dsi_mode = dsi_mode;
@@ -712,10 +716,6 @@ int s6e63m0_probe(struct device *dev, void *trsp,
return PTR_ERR(ctx->reset_gpio);
}
- drm_panel_init(&ctx->panel, dev, &s6e63m0_drm_funcs,
- dsi_mode ? DRM_MODE_CONNECTOR_DSI :
- DRM_MODE_CONNECTOR_DPI);
-
ret = s6e63m0_backlight_register(ctx, max_brightness);
if (ret < 0)
return ret;
Reviewed-by: Neil Armstrong <neil.armstrong@xxxxxxxxxx>
Thanks,
Neil