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 <asrivats@redhat.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250401-b4-drm-panel-mass-driver-convert-v1-8-cdd7615e1f93@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
Anusha Srivatsa
2025-04-01 12:03:51 -04:00
committed by Maxime Ripard
parent 5d2b55e55e
commit ff97cc8a55

View File

@@ -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;