Skip to contentSkip to conversation

drm/bridge: Add stubs for devm_drm_of_get_bridge when OF is disabled

PATCH Applied Maxime Ripard 2 participants 3 messages Sep 28, 2021 – Sep 30, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/bridge: Add stubs for devm_drm_of_get_bridge when OF is disabled

If CONFIG_OF is disabled, devm_drm_of_get_bridge won't be compiled in and drivers using that function will fail to build.

Add an inline stub so that we can still build-test those cases.

---
 include/drm/drm_bridge.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
include/drm/drm_bridge.h +12 -1
index 9cdbd209388e..1648ce265cba 100644
@@ -911,9 +911,20 @@ struct drm_bridge *devm_drm_panel_bridge_add(struct device *dev,
 struct drm_bridge *devm_drm_panel_bridge_add_typed(struct device *dev,
 						   struct drm_panel *panel,
 						   u32 connector_type);
+struct drm_connector *drm_panel_bridge_connector(struct drm_bridge *bridge);
+#endif
+
+#if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL_BRIDGE)
 struct drm_bridge *devm_drm_of_get_bridge(struct device *dev, struct device_node *node,
 					  u32 port, u32 endpoint);
-struct drm_connector *drm_panel_bridge_connector(struct drm_bridge *bridge);
+#else
+static inline struct drm_bridge *devm_drm_of_get_bridge(struct device *dev,
+							struct device_node *node,
+							u32 port,
+							u32 endpoint)
+{
+	return ERR_PTR(-ENODEV);
+}
 #endif
 
 #endif
Signature · 1 line
2.31.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Maxime Ripard

If CONFIG_OF is disabled, devm_drm_of_get_bridge won't be compiled in and drivers using that function will fail to build.

Add an inline stub so that we can still build-test those cases.

Thanks.

Quoted 31 lines
---
  include/drm/drm_bridge.h | 13 ++++++++++++-
  1 file changed, 12 insertions(+), 1 deletion(-)
include/drm/drm_bridge.h +12 -1
index 9cdbd209388e..1648ce265cba 100644
@@ -911,9 +911,20 @@ struct drm_bridge *devm_drm_panel_bridge_add(struct device *dev,
  struct drm_bridge *devm_drm_panel_bridge_add_typed(struct device *dev,
  						   struct drm_panel *panel,
  						   u32 connector_type);
+struct drm_connector *drm_panel_bridge_connector(struct drm_bridge *bridge);
+#endif
+
+#if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL_BRIDGE)
  struct drm_bridge *devm_drm_of_get_bridge(struct device *dev, struct device_node *node,
  					  u32 port, u32 endpoint);
-struct drm_connector *drm_panel_bridge_connector(struct drm_bridge *bridge);
+#else
+static inline struct drm_bridge *devm_drm_of_get_bridge(struct device *dev,
+							struct device_node *node,
+							u32 port,
+							u32 endpoint)
+{
+	return ERR_PTR(-ENODEV);
+}
  #endif
 
  #endif
Signature · 1 line
~Randy
author Applied
#2 lore raw

Re: (subset) [PATCH] drm/bridge: Add stubs for devm_drm_of_get_bridge when OF is disabled

In reply to Maxime Ripard
Quoted 6 lines · Maxime Ripard

If CONFIG_OF is disabled, devm_drm_of_get_bridge won't be compiled in and drivers using that function will fail to build.

Add an inline stub so that we can still build-test those cases.

Applied to drm/drm-misc (drm-misc-next).

Thanks!
Maxime