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

drm/panel/himax-hx83102: 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-12-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>

authored by

Anusha Srivatsa and committed by
Maxime Ripard
46c8779b ea8642fe

+5 -5
+5 -5
drivers/gpu/drm/panel/panel-himax-hx83102.c
··· 989 989 990 990 ctx->base.prepare_prev_first = true; 991 991 992 - drm_panel_init(&ctx->base, dev, &hx83102_drm_funcs, 993 - DRM_MODE_CONNECTOR_DSI); 994 992 err = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation); 995 993 if (err < 0) 996 994 return dev_err_probe(dev, err, "failed to get orientation\n"); ··· 1011 1013 int ret; 1012 1014 const struct hx83102_panel_desc *desc; 1013 1015 1014 - ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL); 1015 - if (!ctx) 1016 - return -ENOMEM; 1016 + ctx = devm_drm_panel_alloc(&dsi->dev, __typeof(*ctx), base, 1017 + &hx83102_drm_funcs, DRM_MODE_CONNECTOR_DSI); 1018 + 1019 + if (IS_ERR(ctx)) 1020 + return PTR_ERR(ctx); 1017 1021 1018 1022 desc = of_device_get_match_data(&dsi->dev); 1019 1023 dsi->lanes = 4;