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

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

authored by

Anusha Srivatsa and committed by
Maxime Ripard
e59e1f45 81cb8735

+4 -6
+4 -6
drivers/gpu/drm/panel/panel-novatek-nt35950.c
··· 449 449 const struct mipi_dsi_device_info *info; 450 450 int i, num_dsis = 1, ret; 451 451 452 - nt = devm_kzalloc(dev, sizeof(*nt), GFP_KERNEL); 453 - if (!nt) 454 - return -ENOMEM; 452 + nt = devm_drm_panel_alloc(dev, struct nt35950, panel, &nt35950_panel_funcs, 453 + DRM_MODE_CONNECTOR_DSI); 454 + if (IS_ERR(nt)) 455 + return PTR_ERR(nt); 455 456 456 457 ret = nt35950_sharp_init_vregs(nt, dev); 457 458 if (ret) ··· 491 490 492 491 nt->dsi[0] = dsi; 493 492 mipi_dsi_set_drvdata(dsi, nt); 494 - 495 - drm_panel_init(&nt->panel, dev, &nt35950_panel_funcs, 496 - DRM_MODE_CONNECTOR_DSI); 497 493 498 494 ret = drm_panel_of_backlight(&nt->panel); 499 495 if (ret) {