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

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

authored by

Anusha Srivatsa and committed by
Maxime Ripard
417f0eb9 47b74d7c

+5 -6
+5 -6
drivers/gpu/drm/panel/panel-newvision-nv3051d.c
··· 361 361 struct panel_nv3051d *ctx; 362 362 int ret; 363 363 364 - ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); 365 - if (!ctx) 366 - return -ENOMEM; 364 + ctx = devm_drm_panel_alloc(dev, struct panel_nv3051d, panel, 365 + &panel_nv3051d_funcs, 366 + DRM_MODE_CONNECTOR_DSI); 367 + if (IS_ERR(ctx)) 368 + return PTR_ERR(ctx); 367 369 368 370 ctx->dev = dev; 369 371 ··· 392 390 dsi->lanes = 4; 393 391 dsi->format = MIPI_DSI_FMT_RGB888; 394 392 dsi->mode_flags = ctx->panel_info->mode_flags; 395 - 396 - drm_panel_init(&ctx->panel, &dsi->dev, &panel_nv3051d_funcs, 397 - DRM_MODE_CONNECTOR_DSI); 398 393 399 394 ret = drm_panel_of_backlight(&ctx->panel); 400 395 if (ret)