]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
panel/ilitek-ili9806e: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Wed, 21 May 2025 03:03:40 +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: Michael Walle <mwalle@kernel.org>
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-9-f7ae7b723c68@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/panel/panel-ilitek-ili9806e.c

index a3c79ad99d0bd03f37442c53d4d9dd0e32012ac7..18aa6222b0c557f4ca703922a9728f74ad2848dc 100644 (file)
@@ -166,9 +166,10 @@ static int ili9806e_dsi_probe(struct mipi_dsi_device *dsi)
        struct ili9806e_panel *ctx;
        int i, ret;
 
-       ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
-       if (!ctx)
-               return -ENOMEM;
+       ctx = devm_drm_panel_alloc(dev, struct ili9806e_panel, panel, &ili9806e_funcs,
+                                  DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(ctx))
+               return PTR_ERR(ctx);
 
        ctx->desc = device_get_match_data(dev);
 
@@ -192,9 +193,6 @@ static int ili9806e_dsi_probe(struct mipi_dsi_device *dsi)
        dsi->format = ctx->desc->format;
        dsi->lanes = ctx->desc->lanes;
 
-       drm_panel_init(&ctx->panel, dev, &ili9806e_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation);
        if (ret)
                return dev_err_probe(dev, ret, "Failed to get orientation\n");