]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
panel/novatek-nt35950: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Wed, 21 May 2025 03:03:56 +0000 (22:03 -0500)
committerMaxime Ripard <mripard@kernel.org>
Wed, 21 May 2025 06:41:08 +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-25-f7ae7b723c68@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/panel/panel-novatek-nt35950.c

index 08b22b592ab0452973aa7373dd0692a9bf98e5f2..94aa6489d99fc88f1602c4dbbf4f7f78c04799a9 100644 (file)
@@ -449,9 +449,10 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
        const struct mipi_dsi_device_info *info;
        int i, num_dsis = 1, ret;
 
-       nt = devm_kzalloc(dev, sizeof(*nt), GFP_KERNEL);
-       if (!nt)
-               return -ENOMEM;
+       nt = devm_drm_panel_alloc(dev, struct nt35950, panel, &nt35950_panel_funcs,
+                                 DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(nt))
+               return PTR_ERR(nt);
 
        ret = nt35950_sharp_init_vregs(nt, dev);
        if (ret)
@@ -491,9 +492,6 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
        nt->dsi[0] = dsi;
        mipi_dsi_set_drvdata(dsi, nt);
 
-       drm_panel_init(&nt->panel, dev, &nt35950_panel_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        ret = drm_panel_of_backlight(&nt->panel);
        if (ret) {
                if (num_dsis == 2)