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

drm/panel/novatek-nt36672a: 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-5-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>

authored by

Anusha Srivatsa and committed by
Maxime Ripard
a8f268ac 6afbf43e

+5 -5
+5 -5
drivers/gpu/drm/panel/panel-novatek-nt36672a.c
··· 608 608 return dev_err_probe(dev, PTR_ERR(pinfo->reset_gpio), 609 609 "failed to get reset gpio from DT\n"); 610 610 611 - drm_panel_init(&pinfo->base, dev, &panel_funcs, DRM_MODE_CONNECTOR_DSI); 612 - 613 611 ret = drm_panel_of_backlight(&pinfo->base); 614 612 if (ret) 615 613 return dev_err_probe(dev, ret, "Failed to get backlight\n"); ··· 623 625 const struct nt36672a_panel_desc *desc; 624 626 int err; 625 627 626 - pinfo = devm_kzalloc(&dsi->dev, sizeof(*pinfo), GFP_KERNEL); 627 - if (!pinfo) 628 - return -ENOMEM; 628 + pinfo = devm_drm_panel_alloc(&dsi->dev, __typeof(*pinfo), base, 629 + &panel_funcs, DRM_MODE_CONNECTOR_DSI); 630 + 631 + if (IS_ERR(pinfo)) 632 + return PTR_ERR(pinfo); 629 633 630 634 desc = of_device_get_match_data(&dsi->dev); 631 635 dsi->mode_flags = desc->mode_flags;