]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/panel/osd101t2587-53ts: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Fri, 11 Jul 2025 04:31:15 +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-4-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c

index dbea84f515142dbf77236552643bb0e4546d0ca8..2334b77f348ce61e98b74f7b26d4021be412c376 100644 (file)
@@ -132,9 +132,6 @@ static int osd101t2587_panel_add(struct osd101t2587_panel *osd101t2587)
        if (IS_ERR(osd101t2587->supply))
                return PTR_ERR(osd101t2587->supply);
 
-       drm_panel_init(&osd101t2587->base, &osd101t2587->dsi->dev,
-                      &osd101t2587_panel_funcs, DRM_MODE_CONNECTOR_DSI);
-
        ret = drm_panel_of_backlight(&osd101t2587->base);
        if (ret)
                return ret;
@@ -161,9 +158,12 @@ static int osd101t2587_panel_probe(struct mipi_dsi_device *dsi)
                          MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
                          MIPI_DSI_MODE_NO_EOT_PACKET;
 
-       osd101t2587 = devm_kzalloc(&dsi->dev, sizeof(*osd101t2587), GFP_KERNEL);
-       if (!osd101t2587)
-               return -ENOMEM;
+       osd101t2587 = devm_drm_panel_alloc(&dsi->dev, __typeof(*osd101t2587), base,
+                                          &osd101t2587_panel_funcs,
+                                          DRM_MODE_CONNECTOR_DSI);
+
+       if (IS_ERR(osd101t2587))
+               return PTR_ERR(osd101t2587);
 
        mipi_dsi_set_drvdata(dsi, osd101t2587);