Thread (5 messages) flat view 5 messages, 3 authors, 2015-12-01
STALE3927d

[PATCH V2] reset: Introduce static inline dummy function when CONFIG_RESET_CONTROLLER is not set

From: nm@ti.com (Nishanth Menon)
Date: 2015-12-01 16:39:09
Also in: linux-omap, lkml
Subsystem: reset controller framework, the rest · Maintainers: Philipp Zabel, Linus Torvalds

When CONFIG_RESET_CONTROLLER is not defined (example COMPILE_TEST),
provide a dummy static inline implementation.

Signed-off-by: Nishanth Menon <nm@ti.com>
---

V2: Thanks to kbot, I realized i messed up the patch -> hopefully, this revision
has better luck.

V1: https://patchwork.kernel.org/patch/7738191/

 include/linux/reset-controller.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h
index ce6b962ffed4..e294565540db 100644
--- a/include/linux/reset-controller.h
+++ b/include/linux/reset-controller.h
@@ -48,7 +48,18 @@ struct reset_controller_dev {
 	unsigned int nr_resets;
 };
 
+#if IS_ENABLED(CONFIG_RESET_CONTROLLER)
 int reset_controller_register(struct reset_controller_dev *rcdev);
 void reset_controller_unregister(struct reset_controller_dev *rcdev);
+#else
+static inline int reset_controller_register(struct reset_controller_dev *r)
+{
+	return -EINVAL;
+}
+
+static inline void reset_controller_unregister(struct reset_controller_dev *r)
+{
+}
+#endif	/* IS_ENABLED(CONFIG_RESET_CONTROLLER) */
 
 #endif
-- 
2.6.2.402.g2635c2b
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help