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

Signed-off-by: Anusha Srivatsa <asriv...@redhat.com>
---
v2: none
---
 drivers/gpu/drm/panel/panel-novatek-nt35950.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c 
b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
index 
08b22b592ab0452973aa7373dd0692a9bf98e5f2..94aa6489d99fc88f1602c4dbbf4f7f78c04799a9
 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
@@ -449,9 +449,10 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
        const struct mipi_dsi_device_info *info;
        int i, num_dsis = 1, ret;
 
-       nt = devm_kzalloc(dev, sizeof(*nt), GFP_KERNEL);
-       if (!nt)
-               return -ENOMEM;
+       nt = devm_drm_panel_alloc(dev, struct nt35950, panel, 
&nt35950_panel_funcs,
+                                 DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(nt))
+               return PTR_ERR(nt);
 
        ret = nt35950_sharp_init_vregs(nt, dev);
        if (ret)
@@ -491,9 +492,6 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
        nt->dsi[0] = dsi;
        mipi_dsi_set_drvdata(dsi, nt);
 
-       drm_panel_init(&nt->panel, dev, &nt35950_panel_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        ret = drm_panel_of_backlight(&nt->panel);
        if (ret) {
                if (num_dsis == 2)

-- 
2.48.1

Reply via email to