]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/panel/vvx10f034n00: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Fri, 11 Jul 2025 04:31:14 +0000 (23:31 -0500)
committerMaxime Ripard <mripard@kernel.org>
Wed, 16 Jul 2025 14:58:09 +0000 (16:58 +0200)
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.

Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-3-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c

index d1c5c9bc3c56a6fe12096ca7b08e34e490699207..3c3308fc55df08a24d62fadbef00080667ea3902 100644 (file)
@@ -166,9 +166,6 @@ static int wuxga_nt_panel_add(struct wuxga_nt_panel *wuxga_nt)
        if (IS_ERR(wuxga_nt->supply))
                return PTR_ERR(wuxga_nt->supply);
 
-       drm_panel_init(&wuxga_nt->base, &wuxga_nt->dsi->dev,
-                      &wuxga_nt_panel_funcs, DRM_MODE_CONNECTOR_DSI);
-
        ret = drm_panel_of_backlight(&wuxga_nt->base);
        if (ret)
                return ret;
@@ -196,9 +193,12 @@ static int wuxga_nt_panel_probe(struct mipi_dsi_device *dsi)
                        MIPI_DSI_CLOCK_NON_CONTINUOUS |
                        MIPI_DSI_MODE_LPM;
 
-       wuxga_nt = devm_kzalloc(&dsi->dev, sizeof(*wuxga_nt), GFP_KERNEL);
-       if (!wuxga_nt)
-               return -ENOMEM;
+       wuxga_nt = devm_drm_panel_alloc(&dsi->dev, __typeof(*wuxga_nt), base,
+                                       &wuxga_nt_panel_funcs,
+                                       DRM_MODE_CONNECTOR_DSI);
+
+       if (IS_ERR(wuxga_nt))
+               return PTR_ERR(wuxga_nt);
 
        mipi_dsi_set_drvdata(dsi, wuxga_nt);