mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] reset: add WARN_ON(1) to non-optional reset_control_get variants
@ 2016-07-08 10:30 Masahiro Yamada
  2016-07-11 10:50 ` Philipp Zabel
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2016-07-08 10:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: Hans de Goede, Philipp Zabel, Lee Jones, Masahiro Yamada

The difference between with/without _optional variants is WARN_ON(1)
when CONFIG_RESET_CONTROLLER is not defined.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

---

 include/linux/reset.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/include/linux/reset.h b/include/linux/reset.h
index 45a4abe..cb7db61 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -132,6 +132,9 @@ __must_check reset_control_get_exclusive(struct device *dev, const char *id)
 static inline struct reset_control *reset_control_get_shared(
 					struct device *dev, const char *id)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1);
 }
 
@@ -160,6 +163,9 @@ static inline struct reset_control *reset_control_get_optional_shared(
 static inline struct reset_control *of_reset_control_get_exclusive(
 				struct device_node *node, const char *id)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __of_reset_control_get(node, id, 0, 0);
 }
 
@@ -185,6 +191,9 @@ static inline struct reset_control *of_reset_control_get_exclusive(
 static inline struct reset_control *of_reset_control_get_shared(
 				struct device_node *node, const char *id)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __of_reset_control_get(node, id, 0, 1);
 }
 
@@ -202,6 +211,9 @@ static inline struct reset_control *of_reset_control_get_shared(
 static inline struct reset_control *of_reset_control_get_exclusive_by_index(
 					struct device_node *node, int index)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __of_reset_control_get(node, NULL, index, 0);
 }
 
@@ -230,6 +242,9 @@ static inline struct reset_control *of_reset_control_get_exclusive_by_index(
 static inline struct reset_control *of_reset_control_get_shared_by_index(
 					struct device_node *node, int index)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __of_reset_control_get(node, NULL, index, 1);
 }
 
@@ -267,6 +282,9 @@ __must_check devm_reset_control_get_exclusive(struct device *dev,
 static inline struct reset_control *devm_reset_control_get_shared(
 					struct device *dev, const char *id)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __devm_reset_control_get(dev, id, 0, 1);
 }
 
@@ -297,6 +315,9 @@ static inline struct reset_control *devm_reset_control_get_optional_shared(
 static inline struct reset_control *
 devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __devm_reset_control_get(dev, NULL, index, 0);
 }
 
@@ -313,6 +334,9 @@ devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
 static inline struct reset_control *
 devm_reset_control_get_shared_by_index(struct device *dev, int index)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __devm_reset_control_get(dev, NULL, index, 1);
 }
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-11 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-08 10:30 [PATCH] reset: add WARN_ON(1) to non-optional reset_control_get variants Masahiro Yamada
2016-07-11 10:50 ` Philipp Zabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®