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>
This commit is contained in:
Anusha Srivatsa 2025-05-20 22:03:56 -05:00 committed by Maxime Ripard
parent 81cb873542
commit e59e1f4524
No known key found for this signature in database
GPG Key ID: 275FCE19A23DBE76

View File

@ -449,9 +449,10 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
const struct mipi_dsi_device_info *info;
int i, num_dsis = 1, ret;
nt = devm_kzalloc(dev, sizeof(*nt), GFP_KERNEL);
if (!nt)
return -ENOMEM;
nt = devm_drm_panel_alloc(dev, struct nt35950, panel, &nt35950_panel_funcs,
DRM_MODE_CONNECTOR_DSI);
if (IS_ERR(nt))
return PTR_ERR(nt);
ret = nt35950_sharp_init_vregs(nt, dev);
if (ret)
@ -491,9 +492,6 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
nt->dsi[0] = dsi;
mipi_dsi_set_drvdata(dsi, nt);
drm_panel_init(&nt->panel, dev, &nt35950_panel_funcs,
DRM_MODE_CONNECTOR_DSI);
ret = drm_panel_of_backlight(&nt->panel);
if (ret) {
if (num_dsis == 2)