From: Anusha Srivatsa Date: Tue, 1 Apr 2025 16:03:45 +0000 (-0400) Subject: panel/arm-versatile: Use the refcounted allocation in place of devm_kzalloc() X-Git-Tag: v6.16-rc1~144^2~21^2~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=341460a6c27ae74e9dc7f05a2541047a8c65f5ad;p=thirdparty%2Flinux.git panel/arm-versatile: Use the refcounted allocation in place of devm_kzalloc() Move to using the new API devm_drm_panel_alloc() to allocate the panel. Signed-off-by: Anusha Srivatsa Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20250401-b4-drm-panel-mass-driver-convert-v1-2-cdd7615e1f93@redhat.com Signed-off-by: Maxime Ripard --- diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c b/drivers/gpu/drm/panel/panel-arm-versatile.c index 503ecea72c5ea..ea5119018df47 100644 --- a/drivers/gpu/drm/panel/panel-arm-versatile.c +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c @@ -306,9 +306,11 @@ static int versatile_panel_probe(struct platform_device *pdev) return PTR_ERR(map); } - vpanel = devm_kzalloc(dev, sizeof(*vpanel), GFP_KERNEL); - if (!vpanel) - return -ENOMEM; + vpanel = devm_drm_panel_alloc(dev, struct versatile_panel, panel, + &versatile_panel_drm_funcs, + DRM_MODE_CONNECTOR_DPI); + if (IS_ERR(vpanel)) + return PTR_ERR(vpanel); ret = regmap_read(map, SYS_CLCD, &val); if (ret) { @@ -348,9 +350,6 @@ static int versatile_panel_probe(struct platform_device *pdev) dev_info(dev, "panel mounted on IB2 daughterboard\n"); } - drm_panel_init(&vpanel->panel, dev, &versatile_panel_drm_funcs, - DRM_MODE_CONNECTOR_DPI); - drm_panel_add(&vpanel->panel); return 0;