]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
panel/feixin-k101-im2ba02: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Wed, 21 May 2025 03:03:33 +0000 (22:03 -0500)
committerMaxime Ripard <mripard@kernel.org>
Wed, 21 May 2025 06:40:56 +0000 (08:40 +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-2-f7ae7b723c68@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c

index 986e3e192881b50ad3cdbbbc41a2adbf77e8791a..6225501cb174960b38b7672c6ef53fbc98ab4acf 100644 (file)
@@ -443,9 +443,11 @@ static int k101_im2ba02_dsi_probe(struct mipi_dsi_device *dsi)
        unsigned int i;
        int ret;
 
-       ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL);
-       if (!ctx)
-               return -ENOMEM;
+       ctx = devm_drm_panel_alloc(&dsi->dev, struct k101_im2ba02, panel,
+                                  &k101_im2ba02_funcs,
+                                  DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(ctx))
+               return PTR_ERR(ctx);
 
        mipi_dsi_set_drvdata(dsi, ctx);
        ctx->dsi = dsi;
@@ -463,9 +465,6 @@ static int k101_im2ba02_dsi_probe(struct mipi_dsi_device *dsi)
                return dev_err_probe(&dsi->dev, PTR_ERR(ctx->reset),
                                     "Couldn't get our reset GPIO\n");
 
-       drm_panel_init(&ctx->panel, &dsi->dev, &k101_im2ba02_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        ret = drm_panel_of_backlight(&ctx->panel);
        if (ret)
                return ret;