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

index 5bbea734123bc003e3d691040496b1fc679ac94b..98f0782c841114439317e16ac6bb4a5175374ac3 100644 (file)
@@ -456,9 +456,12 @@ static int nt35560_probe(struct mipi_dsi_device *dsi)
        struct nt35560 *nt;
        int ret;
 
-       nt = devm_kzalloc(dev, sizeof(struct nt35560), GFP_KERNEL);
-       if (!nt)
-               return -ENOMEM;
+       nt = devm_drm_panel_alloc(dev, struct nt35560, panel,
+                                 &nt35560_drm_funcs,
+                                 DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(nt))
+               return PTR_ERR(nt);
+
        nt->video_mode = of_property_read_bool(dev->of_node,
                                                "enforce-video-mode");
 
@@ -502,9 +505,6 @@ static int nt35560_probe(struct mipi_dsi_device *dsi)
                return dev_err_probe(dev, PTR_ERR(nt->reset_gpio),
                                     "failed to request GPIO\n");
 
-       drm_panel_init(&nt->panel, dev, &nt35560_drm_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        nt->panel.backlight = devm_backlight_device_register(dev, "nt35560", dev, nt,
                                        &nt35560_bl_ops, &nt35560_bl_props);
        if (IS_ERR(nt->panel.backlight))