drm/exynos: checking for NULL instead of IS_ERR()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 13 Oct 2018 10:21:40 +0000 (13:21 +0300)
committerInki Dae <inki.dae@samsung.com>
Mon, 5 Nov 2018 07:37:24 +0000 (16:37 +0900)
The of_drm_find_panel() function returns error pointers and never NULL
but we the driver assumes that ->panel is NULL when it's not present.

Fixes: 6afb7721e2a0 ("drm/exynos: move connector creation to attach callback")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_dsi.c

index 07af775..32f2567 100644 (file)
@@ -1527,7 +1527,9 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
                }
 
                dsi->panel = of_drm_find_panel(device->dev.of_node);
-               if (dsi->panel) {
+               if (IS_ERR(dsi->panel)) {
+                       dsi->panel = NULL;
+               } else {
                        drm_panel_attach(dsi->panel, &dsi->connector);
                        dsi->connector.status = connector_status_connected;
                }