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

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

authored by

Anusha Srivatsa and committed by
Maxime Ripard
3f08c356 5d5da5ce

+6 -6
+6 -6
drivers/gpu/drm/panel/panel-novatek-nt35510.c
··· 1087 1087 struct nt35510 *nt; 1088 1088 int ret; 1089 1089 1090 - nt = devm_kzalloc(dev, sizeof(struct nt35510), GFP_KERNEL); 1091 - if (!nt) 1092 - return -ENOMEM; 1090 + nt = devm_drm_panel_alloc(dev, struct nt35510, panel, 1091 + &nt35510_drm_funcs, 1092 + DRM_MODE_CONNECTOR_DSI); 1093 + if (IS_ERR(nt)) 1094 + return PTR_ERR(nt); 1095 + 1093 1096 mipi_dsi_set_drvdata(dsi, nt); 1094 1097 nt->dev = dev; 1095 1098 ··· 1144 1141 dev_err(dev, "error getting RESET GPIO\n"); 1145 1142 return PTR_ERR(nt->reset_gpio); 1146 1143 } 1147 - 1148 - drm_panel_init(&nt->panel, dev, &nt35510_drm_funcs, 1149 - DRM_MODE_CONNECTOR_DSI); 1150 1144 1151 1145 /* 1152 1146 * First, try to locate an external backlight (such as on GPIO)