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

index 47bce087e3393345fbde8d2fb4d26a955988c395..142cb1cc067addc5900fd5b25d32298b32d7bb05 100644 (file)
@@ -269,9 +269,11 @@ static int hx83112a_probe(struct mipi_dsi_device *dsi)
        struct hx83112a_panel *ctx;
        int ret;
 
-       ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
-       if (!ctx)
-               return -ENOMEM;
+       ctx = devm_drm_panel_alloc(dev, struct hx83112a_panel, panel,
+                                  &hx83112a_panel_funcs,
+                                  DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(ctx))
+               return PTR_ERR(ctx);
 
        ctx->supplies[0].supply = "vdd1";
        ctx->supplies[1].supply = "vsn";
@@ -295,8 +297,6 @@ static int hx83112a_probe(struct mipi_dsi_device *dsi)
                          MIPI_DSI_MODE_VIDEO_HSE |
                          MIPI_DSI_CLOCK_NON_CONTINUOUS;
 
-       drm_panel_init(&ctx->panel, dev, &hx83112a_panel_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
        ctx->panel.prepare_prev_first = true;
 
        ret = drm_panel_of_backlight(&ctx->panel);