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

panel/ltk500hd1829: Use refcounted allocation in place of devm_kzalloc()

Move to using the new API devm_drm_panel_alloc() to allocate the
panel.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250520-drivers-mass-convert-part2-v3-16-f7ae7b723c68@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>

authored by

Anusha Srivatsa and committed by
Maxime Ripard
deafcd1f da93b863

+5 -6
+5 -6
drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c
··· 604 604 struct device *dev = &dsi->dev; 605 605 int ret; 606 606 607 - ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL); 608 - if (!ctx) 609 - return -ENOMEM; 607 + ctx = devm_drm_panel_alloc(dev, struct ltk500hd1829, panel, 608 + &ltk500hd1829_funcs, 609 + DRM_MODE_CONNECTOR_DSI); 610 + if (IS_ERR(ctx)) 611 + return PTR_ERR(ctx); 610 612 611 613 ctx->panel_desc = of_device_get_match_data(dev); 612 614 if (!ctx->panel_desc) ··· 644 642 dsi->format = MIPI_DSI_FMT_RGB888; 645 643 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | 646 644 MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET; 647 - 648 - drm_panel_init(&ctx->panel, &dsi->dev, &ltk500hd1829_funcs, 649 - DRM_MODE_CONNECTOR_DSI); 650 645 651 646 ret = drm_panel_of_backlight(&ctx->panel); 652 647 if (ret)