drm/panel: novatek,nt39016: Reorder calls in probe
authorPaul Cercueil <paul@crapouillou.net>
Thu, 20 Aug 2020 12:12:55 +0000 (14:12 +0200)
committerPaul Cercueil <paul@crapouillou.net>
Thu, 20 Aug 2020 16:34:28 +0000 (18:34 +0200)
The drm_panel_of_backlight() function must be called after
drm_panel_init(), according to the function's documentation; otherwise
the backlight won't be properly initialized.

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200820121256.32037-2-paul@crapouillou.net
drivers/gpu/drm/panel/panel-novatek-nt39016.c

index 39f7be679da5391f3018c814a52012ae605e676a..daa583030246d4212dfce718949127452b163efc 100644 (file)
@@ -285,6 +285,9 @@ static int nt39016_probe(struct spi_device *spi)
                return PTR_ERR(panel->map);
        }
 
+       drm_panel_init(&panel->drm_panel, dev, &nt39016_funcs,
+                      DRM_MODE_CONNECTOR_DPI);
+
        err = drm_panel_of_backlight(&panel->drm_panel);
        if (err) {
                if (err != -EPROBE_DEFER)
@@ -292,9 +295,6 @@ static int nt39016_probe(struct spi_device *spi)
                return err;
        }
 
-       drm_panel_init(&panel->drm_panel, dev, &nt39016_funcs,
-                      DRM_MODE_CONNECTOR_DPI);
-
        drm_panel_add(&panel->drm_panel);
 
        return 0;