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/khadas-ts050: 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-8-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>

authored by

Anusha Srivatsa and committed by
Maxime Ripard
95ec5c60 6a855c7f

+6 -7
+6 -7
drivers/gpu/drm/panel/panel-khadas-ts050.c
··· 821 821 return dev_err_probe(dev, PTR_ERR(khadas_ts050->enable_gpio), 822 822 "failed to get enable gpio"); 823 823 824 - drm_panel_init(&khadas_ts050->base, &khadas_ts050->link->dev, 825 - &khadas_ts050_panel_funcs, DRM_MODE_CONNECTOR_DSI); 826 - 827 824 err = drm_panel_of_backlight(&khadas_ts050->base); 828 825 if (err) 829 826 return err; ··· 847 850 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | 848 851 MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET; 849 852 850 - khadas_ts050 = devm_kzalloc(&dsi->dev, sizeof(*khadas_ts050), 851 - GFP_KERNEL); 852 - if (!khadas_ts050) 853 - return -ENOMEM; 853 + khadas_ts050 = devm_drm_panel_alloc(&dsi->dev, __typeof(*khadas_ts050), 854 + base, &khadas_ts050_panel_funcs, 855 + DRM_MODE_CONNECTOR_DSI); 856 + 857 + if (IS_ERR(khadas_ts050)) 858 + return PTR_ERR(khadas_ts050); 854 859 855 860 khadas_ts050->panel_data = (struct khadas_ts050_panel_data *)data; 856 861 mipi_dsi_set_drvdata(dsi, khadas_ts050);