]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
panel/samsung-sofef00: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Fri, 30 May 2025 02:46:24 +0000 (21:46 -0500)
committerMaxime Ripard <mripard@kernel.org>
Mon, 2 Jun 2025 07:21:56 +0000 (09:21 +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-22-5d75a3711e40@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/panel/panel-samsung-sofef00.c

index 210a25afe82bf9fcee0e626ade398913e4c34cef..72c4a7e9e9d232da43cc79757df4f365be8a4504 100644 (file)
@@ -191,9 +191,11 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi)
        struct sofef00_panel *ctx;
        int ret;
 
-       ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
-       if (!ctx)
-               return -ENOMEM;
+       ctx = devm_drm_panel_alloc(dev, struct sofef00_panel, panel,
+                                  &sofef00_panel_panel_funcs,
+                                  DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(ctx))
+               return PTR_ERR(ctx);
 
        ctx->supply = devm_regulator_get(dev, "vddio");
        if (IS_ERR(ctx->supply))
@@ -211,9 +213,6 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi)
        dsi->lanes = 4;
        dsi->format = MIPI_DSI_FMT_RGB888;
 
-       drm_panel_init(&ctx->panel, dev, &sofef00_panel_panel_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        ctx->panel.backlight = sofef00_create_backlight(dsi);
        if (IS_ERR(ctx->panel.backlight))
                return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),