[PATCH v5 3/4] drm/tinydrm: Add the dummy versions of drm_of_find_backlight functions

Meghana Madhyastha meghana.madhyastha at gmail.com
Sat Sep 30 09:07:25 UTC 2017


Add the dummy versions (function definition returning -EINVAL) of
drm_of_find_backlight and devm_drm_of_find_backlight in the #else
part of the conditional directive in drm_of.h. This is needed
for drivers where CONFIG_OF is optional.

Signed-off-by: Meghana Madhyastha <meghana.madhyastha at gmail.com>
---
Changes in v5:
-Fix the kbuild errors and warnings such as return 0 instead of -EINVAL.

 include/drm/drm_of.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/include/drm/drm_of.h b/include/drm/drm_of.h
index b2d6e0c..55c9304 100644
--- a/include/drm/drm_of.h
+++ b/include/drm/drm_of.h
@@ -60,6 +60,7 @@ static inline int drm_of_encoder_active_endpoint(struct device_node *node,
 {
 	return -EINVAL;
 }
+
 static inline int drm_of_find_panel_or_bridge(const struct device_node *np,
 					      int port, int endpoint,
 					      struct drm_panel **panel,
@@ -67,6 +68,18 @@ static inline int drm_of_find_panel_or_bridge(const struct device_node *np,
 {
 	return -EINVAL;
 }
+
+static inline struct backlight_device *drm_of_find_backlight(
+					struct device *dev)
+{
+	return 0;
+}
+
+static inline struct backlight_device *devm_drm_of_find_backlight(
+						struct device *dev)
+{
+	return 0;
+}
 #endif
 
 static inline int drm_of_encoder_active_endpoint_id(struct device_node *node,
-- 
2.7.4



More information about the dri-devel mailing list