Skip to content

Commit 8e4e733

Browse files
anushasrivatsmripard
authored andcommitted
drm/panel/vvx10f034n00: 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-3-de73ba81b2f5@redhat.com Signed-off-by: Maxime Ripard <[email protected]>
1 parent 6299cb4 commit 8e4e733

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,6 @@ static int wuxga_nt_panel_add(struct wuxga_nt_panel *wuxga_nt)
166166
if (IS_ERR(wuxga_nt->supply))
167167
return PTR_ERR(wuxga_nt->supply);
168168

169-
drm_panel_init(&wuxga_nt->base, &wuxga_nt->dsi->dev,
170-
&wuxga_nt_panel_funcs, DRM_MODE_CONNECTOR_DSI);
171-
172169
ret = drm_panel_of_backlight(&wuxga_nt->base);
173170
if (ret)
174171
return ret;
@@ -196,9 +193,12 @@ static int wuxga_nt_panel_probe(struct mipi_dsi_device *dsi)
196193
MIPI_DSI_CLOCK_NON_CONTINUOUS |
197194
MIPI_DSI_MODE_LPM;
198195

199-
wuxga_nt = devm_kzalloc(&dsi->dev, sizeof(*wuxga_nt), GFP_KERNEL);
200-
if (!wuxga_nt)
201-
return -ENOMEM;
196+
wuxga_nt = devm_drm_panel_alloc(&dsi->dev, __typeof(*wuxga_nt), base,
197+
&wuxga_nt_panel_funcs,
198+
DRM_MODE_CONNECTOR_DSI);
199+
200+
if (IS_ERR(wuxga_nt))
201+
return PTR_ERR(wuxga_nt);
202202

203203
mipi_dsi_set_drvdata(dsi, wuxga_nt);
204204

0 commit comments

Comments
 (0)