panel/panel-lvds: Use refcounted allocation in place of devm_kzalloc()

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>
This commit is contained in:
Anusha Srivatsa 2025-05-29 21:46:47 -05:00 committed by Maxime Ripard
parent 09d05ec42b
commit f27a5e66fb
No known key found for this signature in database
GPG Key ID: 275FCE19A23DBE76

View 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;