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

index 2ef5ea5eaeeb2062372c594d077bd070975119ed..ad35d0fb0a16787ffb87c365c9939c78ff42d67a 100644 (file)
@@ -143,9 +143,11 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi)
        struct rb070d30_panel *ctx;
        int ret;
 
-       ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL);
-       if (!ctx)
-               return -ENOMEM;
+       ctx = devm_drm_panel_alloc(&dsi->dev, struct rb070d30_panel, panel,
+                                  &rb070d30_panel_funcs,
+                                  DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(ctx))
+               return PTR_ERR(ctx);
 
        ctx->supply = devm_regulator_get(&dsi->dev, "vcc-lcd");
        if (IS_ERR(ctx->supply))
@@ -154,9 +156,6 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi)
        mipi_dsi_set_drvdata(dsi, ctx);
        ctx->dsi = dsi;
 
-       drm_panel_init(&ctx->panel, &dsi->dev, &rb070d30_panel_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        ctx->gpios.reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW);
        if (IS_ERR(ctx->gpios.reset)) {
                dev_err(&dsi->dev, "Couldn't get our reset GPIO\n");