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

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

authored by

Anusha Srivatsa and committed by
Maxime Ripard
b669ce70 95ec5c60

+5 -6
+5 -6
drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
··· 402 402 return dev_err_probe(dev, PTR_ERR(jdi->backlight), 403 403 "failed to register backlight %d\n", ret); 404 404 405 - drm_panel_init(&jdi->base, &jdi->dsi->dev, &jdi_panel_funcs, 406 - DRM_MODE_CONNECTOR_DSI); 407 - 408 405 drm_panel_add(&jdi->base); 409 406 410 407 return 0; ··· 423 426 dsi->mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | 424 427 MIPI_DSI_CLOCK_NON_CONTINUOUS; 425 428 426 - jdi = devm_kzalloc(&dsi->dev, sizeof(*jdi), GFP_KERNEL); 427 - if (!jdi) 428 - return -ENOMEM; 429 + jdi = devm_drm_panel_alloc(&dsi->dev, __typeof(*jdi), base, 430 + &jdi_panel_funcs, DRM_MODE_CONNECTOR_DSI); 431 + 432 + if (IS_ERR(jdi)) 433 + return PTR_ERR(jdi); 429 434 430 435 mipi_dsi_set_drvdata(dsi, jdi); 431 436