]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
panel/samsung-s6d16d0: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Fri, 30 May 2025 02:46:15 +0000 (21:46 -0500)
committerMaxime Ripard <mripard@kernel.org>
Mon, 2 Jun 2025 07:21:52 +0000 (09:21 +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/20250529-b4-drm_panel_mass_driver_convert_part3-v2-13-5d75a3711e40@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/panel/panel-samsung-s6d16d0.c

index 79f611963c6183218b42c7b6c3e2ab298e3fdb99..ba1a02000bb9def0b4afa8a43e13bc7c3c92a51d 100644 (file)
@@ -166,9 +166,11 @@ static int s6d16d0_probe(struct mipi_dsi_device *dsi)
        struct s6d16d0 *s6;
        int ret;
 
-       s6 = devm_kzalloc(dev, sizeof(struct s6d16d0), GFP_KERNEL);
-       if (!s6)
-               return -ENOMEM;
+       s6 = devm_drm_panel_alloc(dev, struct s6d16d0, panel,
+                                 &s6d16d0_drm_funcs,
+                                 DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(s6))
+               return PTR_ERR(s6);
 
        mipi_dsi_set_drvdata(dsi, s6);
        s6->dev = dev;
@@ -200,9 +202,6 @@ static int s6d16d0_probe(struct mipi_dsi_device *dsi)
                return ret;
        }
 
-       drm_panel_init(&s6->panel, dev, &s6d16d0_drm_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        drm_panel_add(&s6->panel);
 
        ret = mipi_dsi_attach(dsi);