Skip to content

Commit 6afbf43

Browse files
anushasrivatsmripard
authored andcommitted
drm/panel/osd101t2587-53ts: 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-4-de73ba81b2f5@redhat.com Signed-off-by: Maxime Ripard <[email protected]>
1 parent 8e4e733 commit 6afbf43

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,6 @@ static int osd101t2587_panel_add(struct osd101t2587_panel *osd101t2587)
132132
if (IS_ERR(osd101t2587->supply))
133133
return PTR_ERR(osd101t2587->supply);
134134

135-
drm_panel_init(&osd101t2587->base, &osd101t2587->dsi->dev,
136-
&osd101t2587_panel_funcs, DRM_MODE_CONNECTOR_DSI);
137-
138135
ret = drm_panel_of_backlight(&osd101t2587->base);
139136
if (ret)
140137
return ret;
@@ -161,9 +158,12 @@ static int osd101t2587_panel_probe(struct mipi_dsi_device *dsi)
161158
MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
162159
MIPI_DSI_MODE_NO_EOT_PACKET;
163160

164-
osd101t2587 = devm_kzalloc(&dsi->dev, sizeof(*osd101t2587), GFP_KERNEL);
165-
if (!osd101t2587)
166-
return -ENOMEM;
161+
osd101t2587 = devm_drm_panel_alloc(&dsi->dev, __typeof(*osd101t2587), base,
162+
&osd101t2587_panel_funcs,
163+
DRM_MODE_CONNECTOR_DSI);
164+
165+
if (IS_ERR(osd101t2587))
166+
return PTR_ERR(osd101t2587);
167167

168168
mipi_dsi_set_drvdata(dsi, osd101t2587);
169169

0 commit comments

Comments
 (0)