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

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

authored by

Anusha Srivatsa and committed by
Maxime Ripard
0678c17a c15e4acd

+5 -6
+5 -6
drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
··· 1506 1506 struct ili9881c *ctx; 1507 1507 int ret; 1508 1508 1509 - ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL); 1510 - if (!ctx) 1511 - return -ENOMEM; 1509 + ctx = devm_drm_panel_alloc(&dsi->dev, struct ili9881c, panel, &ili9881c_funcs, 1510 + DRM_MODE_CONNECTOR_DSI); 1511 + if (IS_ERR(ctx)) 1512 + return PTR_ERR(ctx); 1513 + 1512 1514 mipi_dsi_set_drvdata(dsi, ctx); 1513 1515 ctx->dsi = dsi; 1514 1516 ctx->desc = of_device_get_match_data(&dsi->dev); 1515 - 1516 - drm_panel_init(&ctx->panel, &dsi->dev, &ili9881c_funcs, 1517 - DRM_MODE_CONNECTOR_DSI); 1518 1517 1519 1518 ctx->power = devm_regulator_get(&dsi->dev, "power"); 1520 1519 if (IS_ERR(ctx->power))