]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
panel/sitronix-st7701: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Fri, 30 May 2025 02:46:28 +0000 (21:46 -0500)
committerMaxime Ripard <mripard@kernel.org>
Mon, 2 Jun 2025 07:21:58 +0000 (09:21 +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/20250529-b4-drm_panel_mass_driver_convert_part3-v2-26-5d75a3711e40@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/panel/panel-sitronix-st7701.c

index 1f72ef7ca74c9382aa103cc7c65fdedc7e4755b3..0b83423ce470c4e060c3cd44d38719a412d3cb95 100644 (file)
@@ -1150,9 +1150,10 @@ static int st7701_probe(struct device *dev, int connector_type)
        struct st7701 *st7701;
        int ret;
 
-       st7701 = devm_kzalloc(dev, sizeof(*st7701), GFP_KERNEL);
-       if (!st7701)
-               return -ENOMEM;
+       st7701 = devm_drm_panel_alloc(dev, struct st7701, panel, &st7701_funcs,
+                                     connector_type);
+       if (IS_ERR(st7701))
+               return PTR_ERR(st7701);
 
        desc = of_device_get_match_data(dev);
        if (!desc)
@@ -1176,7 +1177,6 @@ static int st7701_probe(struct device *dev, int connector_type)
        if (ret < 0)
                return dev_err_probe(dev, ret, "Failed to get orientation\n");
 
-       drm_panel_init(&st7701->panel, dev, &st7701_funcs, connector_type);
        st7701->panel.prepare_prev_first = true;
 
        /**