Skip to content

Commit d27da67

Browse files
anushasrivatsmripard
authored andcommitted
drm/panel/boe-himax8279d: Use refcounted allocation in place of devm_kzalloc()
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 <[email protected]> Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-14-de73ba81b2f5@redhat.com Signed-off-by: Maxime Ripard <[email protected]>
1 parent 51929b6 commit d27da67

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/gpu/drm/panel/panel-boe-himax8279d.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -847,9 +847,6 @@ static int panel_add(struct panel_info *pinfo)
847847
"failed to get enable gpio\n");
848848
}
849849

850-
drm_panel_init(&pinfo->base, dev, &panel_funcs,
851-
DRM_MODE_CONNECTOR_DSI);
852-
853850
ret = drm_panel_of_backlight(&pinfo->base);
854851
if (ret)
855852
return ret;
@@ -865,9 +862,11 @@ static int panel_probe(struct mipi_dsi_device *dsi)
865862
const struct panel_desc *desc;
866863
int err;
867864

868-
pinfo = devm_kzalloc(&dsi->dev, sizeof(*pinfo), GFP_KERNEL);
869-
if (!pinfo)
870-
return -ENOMEM;
865+
pinfo = devm_drm_panel_alloc(&dsi->dev, __typeof(*pinfo), base,
866+
&panel_funcs, DRM_MODE_CONNECTOR_DSI);
867+
868+
if (IS_ERR(pinfo))
869+
return PTR_ERR(pinfo);
871870

872871
desc = of_device_get_match_data(&dsi->dev);
873872
dsi->mode_flags = desc->mode_flags;

0 commit comments

Comments
 (0)