Move to using the new API devm_drm_panel_alloc() to allocate the
panel.

Signed-off-by: Anusha Srivatsa <asriv...@redhat.com>
---
 drivers/gpu/drm/panel/panel-innolux-p079zca.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c 
b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
index 
d95c0d4f3e3534d70901864fa9ed0fff8f37d236..80afeeab9475fa13ddadb44cd03a1519d448e24e
 100644
--- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
+++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
@@ -382,9 +382,11 @@ static int innolux_panel_add(struct mipi_dsi_device *dsi,
        struct device *dev = &dsi->dev;
        int err, i;
 
-       innolux = devm_kzalloc(dev, sizeof(*innolux), GFP_KERNEL);
-       if (!innolux)
-               return -ENOMEM;
+       innolux = devm_drm_panel_alloc(dev, struct innolux_panel, base,
+                                      &innolux_panel_funcs,
+                                      DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(innolux))
+               return PTR_ERR(innolux);
 
        innolux->desc = desc;
 
@@ -410,9 +412,6 @@ static int innolux_panel_add(struct mipi_dsi_device *dsi,
                innolux->enable_gpio = NULL;
        }
 
-       drm_panel_init(&innolux->base, dev, &innolux_panel_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        err = drm_panel_of_backlight(&innolux->base);
        if (err)
                return err;

-- 
2.48.1

Reply via email to