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

index eb0f8373258c346ccdffd5f8052a5923cd21e203..5c2530598ddb99a0ebdfc7e304b92d11ebf9a50a 100644 (file)
@@ -1120,9 +1120,10 @@ static int jadard_dsi_probe(struct mipi_dsi_device *dsi)
        struct jadard *jadard;
        int ret;
 
-       jadard = devm_kzalloc(&dsi->dev, sizeof(*jadard), GFP_KERNEL);
-       if (!jadard)
-               return -ENOMEM;
+       jadard = devm_drm_panel_alloc(dev, struct jadard, panel, &jadard_funcs,
+                                     DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(jadard))
+               return PTR_ERR(jadard);
 
        desc = of_device_get_match_data(dev);
        dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
@@ -1148,9 +1149,6 @@ static int jadard_dsi_probe(struct mipi_dsi_device *dsi)
                return PTR_ERR(jadard->vccio);
        }
 
-       drm_panel_init(&jadard->panel, dev, &jadard_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        ret = of_drm_get_panel_orientation(dev->of_node, &jadard->orientation);
        if (ret < 0)
                return dev_err_probe(dev, ret, "failed to get orientation\n");