Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-10-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>

authored by

Anusha Srivatsa and committed by
Maxime Ripard
d29ab79c b669ce70

+6 -6
+6 -6
drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
··· 435 435 return dev_err_probe(dev, PTR_ERR(jdi->backlight), 436 436 "failed to create backlight\n"); 437 437 438 - drm_panel_init(&jdi->base, &jdi->link1->dev, &jdi_panel_funcs, 439 - DRM_MODE_CONNECTOR_DSI); 440 - 441 438 drm_panel_add(&jdi->base); 442 439 443 440 return 0; ··· 472 475 473 476 /* register a panel for only the DSI-LINK1 interface */ 474 477 if (secondary) { 475 - jdi = devm_kzalloc(&dsi->dev, sizeof(*jdi), GFP_KERNEL); 476 - if (!jdi) { 478 + jdi = devm_drm_panel_alloc(&dsi->dev, __typeof(*jdi), 479 + base, &jdi_panel_funcs, 480 + DRM_MODE_CONNECTOR_DSI); 481 + 482 + if (IS_ERR(jdi)) { 477 483 put_device(&secondary->dev); 478 - return -ENOMEM; 484 + return PTR_ERR(jdi); 479 485 } 480 486 481 487 mipi_dsi_set_drvdata(dsi, jdi);