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

panel/ltk050h3146w: 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-15-f7ae7b723c68@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>

authored by

Anusha Srivatsa and committed by
Maxime Ripard
da93b863 608cd288

+5 -6
+5 -6
drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
··· 548 548 struct ltk050h3146w *ctx; 549 549 int ret; 550 550 551 - ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); 552 - if (!ctx) 553 - return -ENOMEM; 551 + ctx = devm_drm_panel_alloc(dev, struct ltk050h3146w, panel, 552 + &ltk050h3146w_funcs, 553 + DRM_MODE_CONNECTOR_DSI); 554 + if (IS_ERR(ctx)) 555 + return PTR_ERR(ctx); 554 556 555 557 ctx->panel_desc = of_device_get_match_data(dev); 556 558 if (!ctx->panel_desc) ··· 578 576 dsi->lanes = 4; 579 577 dsi->format = MIPI_DSI_FMT_RGB888; 580 578 dsi->mode_flags = ctx->panel_desc->mode_flags; 581 - 582 - drm_panel_init(&ctx->panel, &dsi->dev, &ltk050h3146w_funcs, 583 - DRM_MODE_CONNECTOR_DSI); 584 579 585 580 ret = drm_panel_of_backlight(&ctx->panel); 586 581 if (ret)