Skip to content

Commit ea8642f

Browse files
anushasrivatsmripard
authored andcommitted
drm/panel/ilitek-ili9882t: 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-11-de73ba81b2f5@redhat.com Signed-off-by: Maxime Ripard <[email protected]>
1 parent d29ab79 commit ea8642f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpu/drm/panel/panel-ilitek-ili9882t.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,6 @@ static int ili9882t_add(struct ili9882t *ili)
614614

615615
gpiod_set_value(ili->enable_gpio, 0);
616616

617-
drm_panel_init(&ili->base, dev, &ili9882t_funcs,
618-
DRM_MODE_CONNECTOR_DSI);
619617
err = of_drm_get_panel_orientation(dev->of_node, &ili->orientation);
620618
if (err < 0) {
621619
dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err);
@@ -640,9 +638,11 @@ static int ili9882t_probe(struct mipi_dsi_device *dsi)
640638
int ret;
641639
const struct panel_desc *desc;
642640

643-
ili = devm_kzalloc(&dsi->dev, sizeof(*ili), GFP_KERNEL);
644-
if (!ili)
645-
return -ENOMEM;
641+
ili = devm_drm_panel_alloc(&dsi->dev, __typeof(*ili), base,
642+
&ili9882t_funcs, DRM_MODE_CONNECTOR_DSI);
643+
644+
if (IS_ERR(ili))
645+
return PTR_ERR(ili);
646646

647647
desc = of_device_get_match_data(&dsi->dev);
648648
dsi->lanes = desc->lanes;

0 commit comments

Comments
 (0)