Skip to content

Commit d29ab79

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

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,6 @@ static int jdi_panel_add(struct jdi_panel *jdi)
435435
return dev_err_probe(dev, PTR_ERR(jdi->backlight),
436436
"failed to create backlight\n");
437437

438-
drm_panel_init(&jdi->base, &jdi->link1->dev, &jdi_panel_funcs,
439-
DRM_MODE_CONNECTOR_DSI);
440-
441438
drm_panel_add(&jdi->base);
442439

443440
return 0;
@@ -475,10 +472,13 @@ static int jdi_panel_dsi_probe(struct mipi_dsi_device *dsi)
475472

476473
/* register a panel for only the DSI-LINK1 interface */
477474
if (secondary) {
478-
jdi = devm_kzalloc(&dsi->dev, sizeof(*jdi), GFP_KERNEL);
479-
if (!jdi) {
475+
jdi = devm_drm_panel_alloc(&dsi->dev, __typeof(*jdi),
476+
base, &jdi_panel_funcs,
477+
DRM_MODE_CONNECTOR_DSI);
478+
479+
if (IS_ERR(jdi)) {
480480
put_device(&secondary->dev);
481-
return -ENOMEM;
481+
return PTR_ERR(jdi);
482482
}
483483

484484
mipi_dsi_set_drvdata(dsi, jdi);

0 commit comments

Comments
 (0)