]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
panel/novatek-nt36523: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Wed, 21 May 2025 03:03:57 +0000 (22:03 -0500)
committerMaxime Ripard <mripard@kernel.org>
Wed, 21 May 2025 06:41:09 +0000 (08:41 +0200)
Move to using the new API devm_drm_panel_alloc() to allocate the
panel.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250520-drivers-mass-convert-part2-v3-26-f7ae7b723c68@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/panel/panel-novatek-nt36523.c

index 116d67bfa1140073cc537ec967b77195beeec051..32cf64c7c18be061fc3d38689529f039bf7cea55 100644 (file)
@@ -1171,9 +1171,11 @@ static int nt36523_probe(struct mipi_dsi_device *dsi)
        const struct mipi_dsi_device_info *info;
        int i, ret;
 
-       pinfo = devm_kzalloc(dev, sizeof(*pinfo), GFP_KERNEL);
-       if (!pinfo)
-               return -ENOMEM;
+       pinfo = devm_drm_panel_alloc(dev, struct panel_info, panel,
+                                    &nt36523_panel_funcs,
+                                    DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(pinfo))
+               return PTR_ERR(pinfo);
 
        pinfo->vddio = devm_regulator_get(dev, "vddio");
        if (IS_ERR(pinfo->vddio))
@@ -1211,7 +1213,6 @@ static int nt36523_probe(struct mipi_dsi_device *dsi)
 
        pinfo->dsi[0] = dsi;
        mipi_dsi_set_drvdata(dsi, pinfo);
-       drm_panel_init(&pinfo->panel, dev, &nt36523_panel_funcs, DRM_MODE_CONNECTOR_DSI);
 
        ret = of_drm_get_panel_orientation(dev->of_node, &pinfo->orientation);
        if (ret < 0) {