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

index 549b86f2cc288741897992ce5cad6325f4289dba..3189d89c7ca00074314a6f4fec330a3e625c24f4 100644 (file)
@@ -1087,9 +1087,12 @@ static int nt35510_probe(struct mipi_dsi_device *dsi)
        struct nt35510 *nt;
        int ret;
 
-       nt = devm_kzalloc(dev, sizeof(struct nt35510), GFP_KERNEL);
-       if (!nt)
-               return -ENOMEM;
+       nt = devm_drm_panel_alloc(dev, struct nt35510, panel,
+                                 &nt35510_drm_funcs,
+                                 DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(nt))
+               return PTR_ERR(nt);
+
        mipi_dsi_set_drvdata(dsi, nt);
        nt->dev = dev;
 
@@ -1142,9 +1145,6 @@ static int nt35510_probe(struct mipi_dsi_device *dsi)
                return PTR_ERR(nt->reset_gpio);
        }
 
-       drm_panel_init(&nt->panel, dev, &nt35510_drm_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        /*
         * First, try to locate an external backlight (such as on GPIO)
         * if this fails, assume we will want to use the internal backlight