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

index ba6c015aabba9e03a37058e0fcf7cb39d1595d70..23fd535d8f479045a87b0f51bec17cd7c66b0f75 100644 (file)
@@ -164,9 +164,11 @@ static int panel_lvds_probe(struct platform_device *pdev)
        struct panel_lvds *lvds;
        int ret;
 
-       lvds = devm_kzalloc(&pdev->dev, sizeof(*lvds), GFP_KERNEL);
-       if (!lvds)
-               return -ENOMEM;
+       lvds = devm_drm_panel_alloc(&pdev->dev, struct panel_lvds, panel,
+                                   &panel_lvds_funcs,
+                                   DRM_MODE_CONNECTOR_LVDS);
+       if (IS_ERR(lvds))
+               return PTR_ERR(lvds);
 
        lvds->dev = &pdev->dev;
 
@@ -214,10 +216,6 @@ static int panel_lvds_probe(struct platform_device *pdev)
         * driver.
         */
 
-       /* Register the panel. */
-       drm_panel_init(&lvds->panel, lvds->dev, &panel_lvds_funcs,
-                      DRM_MODE_CONNECTOR_LVDS);
-
        ret = drm_panel_of_backlight(&lvds->panel);
        if (ret)
                return ret;