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 <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-4-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
Anusha Srivatsa 2025-07-10 23:31:15 -05:00 committed by Maxime Ripard
parent 8e4e733d95
commit 6afbf43edf
No known key found for this signature in database
GPG key ID: 275FCE19A23DBE76

View file

@ -132,9 +132,6 @@ static int osd101t2587_panel_add(struct osd101t2587_panel *osd101t2587)
if (IS_ERR(osd101t2587->supply))
return PTR_ERR(osd101t2587->supply);
drm_panel_init(&osd101t2587->base, &osd101t2587->dsi->dev,
&osd101t2587_panel_funcs, DRM_MODE_CONNECTOR_DSI);
ret = drm_panel_of_backlight(&osd101t2587->base);
if (ret)
return ret;
@ -161,9 +158,12 @@ static int osd101t2587_panel_probe(struct mipi_dsi_device *dsi)
MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
MIPI_DSI_MODE_NO_EOT_PACKET;
osd101t2587 = devm_kzalloc(&dsi->dev, sizeof(*osd101t2587), GFP_KERNEL);
if (!osd101t2587)
return -ENOMEM;
osd101t2587 = devm_drm_panel_alloc(&dsi->dev, __typeof(*osd101t2587), base,
&osd101t2587_panel_funcs,
DRM_MODE_CONNECTOR_DSI);
if (IS_ERR(osd101t2587))
return PTR_ERR(osd101t2587);
mipi_dsi_set_drvdata(dsi, osd101t2587);