Skip to content

Commit b669ce7

Browse files
anushasrivatsmripard
authored andcommitted
drm/panel/jdi-lt070me05000: 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-9-de73ba81b2f5@redhat.com Signed-off-by: Maxime Ripard <[email protected]>
1 parent 95ec5c6 commit b669ce7

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/gpu/drm/panel/panel-jdi-lt070me05000.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,6 @@ static int jdi_panel_add(struct jdi_panel *jdi)
402402
return dev_err_probe(dev, PTR_ERR(jdi->backlight),
403403
"failed to register backlight %d\n", ret);
404404

405-
drm_panel_init(&jdi->base, &jdi->dsi->dev, &jdi_panel_funcs,
406-
DRM_MODE_CONNECTOR_DSI);
407-
408405
drm_panel_add(&jdi->base);
409406

410407
return 0;
@@ -426,9 +423,11 @@ static int jdi_panel_probe(struct mipi_dsi_device *dsi)
426423
dsi->mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO |
427424
MIPI_DSI_CLOCK_NON_CONTINUOUS;
428425

429-
jdi = devm_kzalloc(&dsi->dev, sizeof(*jdi), GFP_KERNEL);
430-
if (!jdi)
431-
return -ENOMEM;
426+
jdi = devm_drm_panel_alloc(&dsi->dev, __typeof(*jdi), base,
427+
&jdi_panel_funcs, DRM_MODE_CONNECTOR_DSI);
428+
429+
if (IS_ERR(jdi))
430+
return PTR_ERR(jdi);
432431

433432
mipi_dsi_set_drvdata(dsi, jdi);
434433

0 commit comments

Comments
 (0)