]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
panel/ilitek-ili9881c: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Wed, 21 May 2025 03:03:41 +0000 (22:03 -0500)
committerMaxime Ripard <mripard@kernel.org>
Wed, 21 May 2025 06:41:00 +0000 (08:41 +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/20250520-drivers-mass-convert-part2-v3-10-f7ae7b723c68@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/panel/panel-ilitek-ili9881c.c

index 28cd7560e5db1d5734b10babdb4e4e553c6e07d0..aa4192def09353afa40c1981d0b105064fe95b02 100644 (file)
@@ -1506,16 +1506,15 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
        struct ili9881c *ctx;
        int ret;
 
-       ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL);
-       if (!ctx)
-               return -ENOMEM;
+       ctx = devm_drm_panel_alloc(&dsi->dev, struct ili9881c, panel, &ili9881c_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);
 
-       drm_panel_init(&ctx->panel, &dsi->dev, &ili9881c_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        ctx->power = devm_regulator_get(&dsi->dev, "power");
        if (IS_ERR(ctx->power))
                return dev_err_probe(&dsi->dev, PTR_ERR(ctx->power),