]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
panel/panel-ili9805: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Wed, 21 May 2025 03:03:39 +0000 (22:03 -0500)
committerMaxime Ripard <mripard@kernel.org>
Wed, 21 May 2025 06:40:59 +0000 (08:40 +0200)
Start using the new helper that does the refcounted
allocations

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250520-drivers-mass-convert-part2-v3-8-f7ae7b723c68@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/panel/panel-ilitek-ili9805.c

index 1cbc25758bd2bc0ed1ea64eed61edc7cdda68f9e..e6c483851f1f322c7f7c65e7816d94ddec146e4f 100644 (file)
@@ -307,9 +307,12 @@ static int ili9805_dsi_probe(struct mipi_dsi_device *dsi)
        struct ili9805 *ctx;
        int ret;
 
-       ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL);
-       if (!ctx)
-               return -ENOMEM;
+       ctx = devm_drm_panel_alloc(&dsi->dev, struct ili9805, panel,
+                                  &ili9805_funcs,
+                                  DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(ctx))
+               return PTR_ERR(ctx);
+
        mipi_dsi_set_drvdata(dsi, ctx);
        ctx->dsi = dsi;
        ctx->desc = of_device_get_match_data(&dsi->dev);
@@ -320,9 +323,6 @@ static int ili9805_dsi_probe(struct mipi_dsi_device *dsi)
                MIPI_DSI_MODE_VIDEO_SYNC_PULSE | MIPI_DSI_MODE_NO_EOT_PACKET;
        dsi->lanes = 2;
 
-       drm_panel_init(&ctx->panel, &dsi->dev, &ili9805_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        ctx->dvdd = devm_regulator_get(&dsi->dev, "dvdd");
        if (IS_ERR(ctx->dvdd))
                return PTR_ERR(ctx->dvdd);