Skip to content

Commit a8f268a

Browse files
anushasrivatsmripard
authored andcommitted
drm/panel/novatek-nt36672a: Use refcounted allocation in place of devm_kzalloc()
Move to using the new API devm_drm_panel_alloc() to allocate the panel. In the call to the new API, avoid using explicit type and use __typeof() for more type safety. Signed-off-by: Anusha Srivatsa <[email protected]> Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-5-de73ba81b2f5@redhat.com Signed-off-by: Maxime Ripard <[email protected]>
1 parent 6afbf43 commit a8f268a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpu/drm/panel/panel-novatek-nt36672a.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,6 @@ static int nt36672a_panel_add(struct nt36672a_panel *pinfo)
608608
return dev_err_probe(dev, PTR_ERR(pinfo->reset_gpio),
609609
"failed to get reset gpio from DT\n");
610610

611-
drm_panel_init(&pinfo->base, dev, &panel_funcs, DRM_MODE_CONNECTOR_DSI);
612-
613611
ret = drm_panel_of_backlight(&pinfo->base);
614612
if (ret)
615613
return dev_err_probe(dev, ret, "Failed to get backlight\n");
@@ -625,9 +623,11 @@ static int nt36672a_panel_probe(struct mipi_dsi_device *dsi)
625623
const struct nt36672a_panel_desc *desc;
626624
int err;
627625

628-
pinfo = devm_kzalloc(&dsi->dev, sizeof(*pinfo), GFP_KERNEL);
629-
if (!pinfo)
630-
return -ENOMEM;
626+
pinfo = devm_drm_panel_alloc(&dsi->dev, __typeof(*pinfo), base,
627+
&panel_funcs, DRM_MODE_CONNECTOR_DSI);
628+
629+
if (IS_ERR(pinfo))
630+
return PTR_ERR(pinfo);
631631

632632
desc = of_device_get_match_data(&dsi->dev);
633633
dsi->mode_flags = desc->mode_flags;

0 commit comments

Comments
 (0)