[PATCH 4.19 480/639] drm/panel: make drm_panel.h self-contained

From: Greg Kroah-Hartman
Date: Fri Jan 24 2020 - 06:38:56 EST


From: Jani Nikula <jani.nikula@xxxxxxxxx>

[ Upstream commit bf3f5e98559360661a3d2af340d46522512c0b00 ]

Fix build warning if drm_panel.h is built with CONFIG_OF=n or
CONFIG_DRM_PANEL=n and included without the prerequisite err.h:

./include/drm/drm_panel.h: In function âof_drm_find_panelâ:
./include/drm/drm_panel.h:203:9: error: implicit declaration of function âERR_PTRâ [-Werror=implicit-function-declaration]
return ERR_PTR(-ENODEV);
^~~~~~~
./include/drm/drm_panel.h:203:9: error: returning âintâ from a function with return type âstruct drm_panel *â makes pointer from integer without a cast [-Werror=int-conversion]
return ERR_PTR(-ENODEV);
^~~~~~~~~~~~~~~~

Fixes: 5fa8e4a22182 ("drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of NULL")
Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
Acked-by: Thierry Reding <treding@xxxxxxxxxx>
Reviewed-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
Reviewed-by: Sean Paul <sean@xxxxxxxxxx>
Cc: Boris Brezillon <bbrezillon@xxxxxxxxxx>
Signed-off-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
Link: https://patchwork.freedesktop.org/patch/msgid/20190718161507.2047-2-sam@xxxxxxxxxxxx
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
include/drm/drm_panel.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
index 777814755fa62..675aa1e876ce6 100644
--- a/include/drm/drm_panel.h
+++ b/include/drm/drm_panel.h
@@ -24,6 +24,7 @@
#ifndef __DRM_PANEL_H__
#define __DRM_PANEL_H__

+#include <linux/err.h>
#include <linux/errno.h>
#include <linux/list.h>

--
2.20.1