summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnusha Srivatsa <asrivats@redhat.com>2025-04-01 19:03:46 +0300
committerMaxime Ripard <mripard@kernel.org>2025-04-07 11:29:14 +0300
commitd816d1af0fec8b1f8bb6d6f96732c11974ddb2a1 (patch)
tree67fcea72c4e4c448ccffefbd35acf3c0ea3a29c3
parent341460a6c27ae74e9dc7f05a2541047a8c65f5ad (diff)
downloadlinux-d816d1af0fec8b1f8bb6d6f96732c11974ddb2a1.tar.xz
panel/z00t-tm5p5-n35596: Use refcounted allocation in place of devm_kzalloc()
Move to using the new API devm_drm_panel_alloc() to allocate the panel. Signed-off-by: Anusha Srivatsa <asrivats@redhat.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20250401-b4-drm-panel-mass-driver-convert-v1-3-cdd7615e1f93@redhat.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
-rw-r--r--drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c b/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c
index b05a663c134c..db006576d704 100644
--- a/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c
+++ b/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c
@@ -224,9 +224,11 @@ static int tm5p5_nt35596_probe(struct mipi_dsi_device *dsi)
struct tm5p5_nt35596 *ctx;
int ret;
- ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
- if (!ctx)
- return -ENOMEM;
+ ctx = devm_drm_panel_alloc(dev, struct tm5p5_nt35596, panel,
+ &tm5p5_nt35596_panel_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+ if (IS_ERR(ctx))
+ return PTR_ERR(ctx);
ctx->supplies[0].supply = "vdd";
ctx->supplies[1].supply = "vddio";
@@ -253,9 +255,6 @@ static int tm5p5_nt35596_probe(struct mipi_dsi_device *dsi)
MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_NO_EOT_PACKET |
MIPI_DSI_CLOCK_NON_CONTINUOUS | MIPI_DSI_MODE_LPM;
- drm_panel_init(&ctx->panel, dev, &tm5p5_nt35596_panel_funcs,
- DRM_MODE_CONNECTOR_DSI);
-
ctx->panel.backlight = tm5p5_nt35596_create_backlight(dsi);
if (IS_ERR(ctx->panel.backlight)) {
ret = PTR_ERR(ctx->panel.backlight);