From: Anusha Srivatsa Date: Tue, 1 Apr 2025 16:03:51 +0000 (-0400) Subject: panel/dsi-cm: Use refcounted allocation in place of devm_kzalloc() X-Git-Tag: v6.16-rc1~144^2~21^2~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ff97cc8a55a539ec8be548a800d5ac317b2df133;p=thirdparty%2Flinux.git panel/dsi-cm: Use 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-8-cdd7615e1f93@redhat.com Signed-off-by: Maxime Ripard --- diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c b/drivers/gpu/drm/panel/panel-dsi-cm.c index 6b3f4d664d2ad..ae6e9ffc46cb4 100644 --- a/drivers/gpu/drm/panel/panel-dsi-cm.c +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c @@ -511,9 +511,10 @@ static int dsicm_probe(struct mipi_dsi_device *dsi) dev_dbg(dev, "probe\n"); - ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL); - if (!ddata) - return -ENOMEM; + ddata = devm_drm_panel_alloc(dev, struct panel_drv_data, panel, + &dsicm_panel_funcs, DRM_MODE_CONNECTOR_DSI); + if (IS_ERR(ddata)) + return PTR_ERR(ddata); mipi_dsi_set_drvdata(dsi, ddata); ddata->dsi = dsi; @@ -530,9 +531,6 @@ static int dsicm_probe(struct mipi_dsi_device *dsi) dsicm_hw_reset(ddata); - drm_panel_init(&ddata->panel, dev, &dsicm_panel_funcs, - DRM_MODE_CONNECTOR_DSI); - if (ddata->use_dsi_backlight) { struct backlight_properties props = { 0 }; props.max_brightness = 255;