mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
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:
parent
09d05ec42b
commit
f27a5e66fb
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user