Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-11-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>

authored by

Anusha Srivatsa and committed by
Maxime Ripard
ea8642fe d29ab79c

+5 -5
+5 -5
drivers/gpu/drm/panel/panel-ilitek-ili9882t.c
··· 614 614 615 615 gpiod_set_value(ili->enable_gpio, 0); 616 616 617 - drm_panel_init(&ili->base, dev, &ili9882t_funcs, 618 - DRM_MODE_CONNECTOR_DSI); 619 617 err = of_drm_get_panel_orientation(dev->of_node, &ili->orientation); 620 618 if (err < 0) { 621 619 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err); ··· 638 640 int ret; 639 641 const struct panel_desc *desc; 640 642 641 - ili = devm_kzalloc(&dsi->dev, sizeof(*ili), GFP_KERNEL); 642 - if (!ili) 643 - return -ENOMEM; 643 + ili = devm_drm_panel_alloc(&dsi->dev, __typeof(*ili), base, 644 + &ili9882t_funcs, DRM_MODE_CONNECTOR_DSI); 645 + 646 + if (IS_ERR(ili)) 647 + return PTR_ERR(ili); 644 648 645 649 desc = of_device_get_match_data(&dsi->dev); 646 650 dsi->lanes = desc->lanes;