]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
panel/truly-nt35521: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Fri, 30 May 2025 02:46:33 +0000 (21:46 -0500)
committerMaxime Ripard <mripard@kernel.org>
Mon, 2 Jun 2025 07:22:01 +0000 (09:22 +0200)
Move to using the new API devm_drm_panel_alloc() to allocate the
panel.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250529-b4-drm_panel_mass_driver_convert_part3-v2-31-5d75a3711e40@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/panel/panel-sony-tulip-truly-nt35521.c

index 104b2290560e366cd514617f04233e4940d7bb03..216a6ad8696e91c4ea717476d46105b7d636b765 100644 (file)
@@ -433,9 +433,11 @@ static int truly_nt35521_probe(struct mipi_dsi_device *dsi)
        struct truly_nt35521 *ctx;
        int ret;
 
-       ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
-       if (!ctx)
-               return -ENOMEM;
+       ctx = devm_drm_panel_alloc(dev, struct truly_nt35521, panel,
+                                  &truly_nt35521_panel_funcs,
+                                  DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(ctx))
+               return PTR_ERR(ctx);
 
        ctx->supplies[0].supply = "positive5";
        ctx->supplies[1].supply = "negative5";
@@ -465,9 +467,6 @@ static int truly_nt35521_probe(struct mipi_dsi_device *dsi)
                          MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_NO_EOT_PACKET |
                          MIPI_DSI_CLOCK_NON_CONTINUOUS;
 
-       drm_panel_init(&ctx->panel, dev, &truly_nt35521_panel_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        ctx->panel.backlight = truly_nt35521_create_backlight(dsi);
        if (IS_ERR(ctx->panel.backlight))
                return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),