panel/novatek-nt35560: 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-24-f7ae7b723c68@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
Anusha Srivatsa 2025-05-20 22:03:55 -05:00 committed by Maxime Ripard
parent 3f08c356b8
commit 81cb873542
No known key found for this signature in database
GPG Key ID: 275FCE19A23DBE76

View File

@ -456,9 +456,12 @@ static int nt35560_probe(struct mipi_dsi_device *dsi)
struct nt35560 *nt;
int ret;
nt = devm_kzalloc(dev, sizeof(struct nt35560), GFP_KERNEL);
if (!nt)
return -ENOMEM;
nt = devm_drm_panel_alloc(dev, struct nt35560, panel,
&nt35560_drm_funcs,
DRM_MODE_CONNECTOR_DSI);
if (IS_ERR(nt))
return PTR_ERR(nt);
nt->video_mode = of_property_read_bool(dev->of_node,
"enforce-video-mode");
@ -502,9 +505,6 @@ static int nt35560_probe(struct mipi_dsi_device *dsi)
return dev_err_probe(dev, PTR_ERR(nt->reset_gpio),
"failed to request GPIO\n");
drm_panel_init(&nt->panel, dev, &nt35560_drm_funcs,
DRM_MODE_CONNECTOR_DSI);
nt->panel.backlight = devm_backlight_device_register(dev, "nt35560", dev, nt,
&nt35560_bl_ops, &nt35560_bl_props);
if (IS_ERR(nt->panel.backlight))