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

index fc87f61d4400d49814953d7f453a7c6e84004f29..3231e84dc66c2bf319f5287fd53bc437e24e0d5b 100644 (file)
@@ -237,9 +237,11 @@ static int ota5601a_probe(struct spi_device *spi)
        struct ota5601a *panel;
        int err;
 
-       panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
-       if (!panel)
-               return -ENOMEM;
+       panel = devm_drm_panel_alloc(dev, struct ota5601a, drm_panel,
+                                    &ota5601a_funcs,
+                                    DRM_MODE_CONNECTOR_DPI);
+       if (IS_ERR(panel))
+               return PTR_ERR(panel);
 
        spi_set_drvdata(spi, panel);
 
@@ -273,9 +275,6 @@ static int ota5601a_probe(struct spi_device *spi)
                return PTR_ERR(panel->map);
        }
 
-       drm_panel_init(&panel->drm_panel, dev, &ota5601a_funcs,
-                      DRM_MODE_CONNECTOR_DPI);
-
        err = drm_panel_of_backlight(&panel->drm_panel);
        if (err) {
                if (err != -EPROBE_DEFER)