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

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

authored by

Anusha Srivatsa and committed by
Maxime Ripard
39cfc68b 74ca3ba0

+5 -6
+5 -6
drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c
··· 443 443 unsigned int i; 444 444 int ret; 445 445 446 - ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL); 447 - if (!ctx) 448 - return -ENOMEM; 446 + ctx = devm_drm_panel_alloc(&dsi->dev, struct k101_im2ba02, panel, 447 + &k101_im2ba02_funcs, 448 + DRM_MODE_CONNECTOR_DSI); 449 + if (IS_ERR(ctx)) 450 + return PTR_ERR(ctx); 449 451 450 452 mipi_dsi_set_drvdata(dsi, ctx); 451 453 ctx->dsi = dsi; ··· 464 462 if (IS_ERR(ctx->reset)) 465 463 return dev_err_probe(&dsi->dev, PTR_ERR(ctx->reset), 466 464 "Couldn't get our reset GPIO\n"); 467 - 468 - drm_panel_init(&ctx->panel, &dsi->dev, &k101_im2ba02_funcs, 469 - DRM_MODE_CONNECTOR_DSI); 470 465 471 466 ret = drm_panel_of_backlight(&ctx->panel); 472 467 if (ret)