Skip to contentSkip to conversation

reset: Fix compile when reset RESET_CONTROLLER is not selected

PATCH New John Crispin 1 participant 1 message Aug 9, 2013 Reset controller framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 reset: Fix compile when reset RESET_CONTROLLER is not selected

Drivers need to protect their reset api calls with #ifdef to avoid compile errors. This patch adds dummy wrappers in the same way that linux/of.h does it. This results in the nasty ifdefs no longer being needed.

Cc Philipp Zabel <[email protected]>
Cc Gabor Juhos <[email protected]>
---
 include/linux/reset-controller.h |   16 ++++++++++++++
 include/linux/reset.h            |   43 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)
include/linux/reset-controller.h +16 -0
index 2f61311..068f073 100644
@@ -45,7 +45,23 @@ struct reset_controller_dev {
 	unsigned int nr_resets;
 };
 
+#if defined(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 *rcdev)
+{
+	return -ENOSYS;
+}
+
+void reset_controller_unregister(struct reset_controller_dev *rcdev)
+{
+
+}
+
+#endif
+
 #endif
include/linux/reset.h +43 -0

56 lines not on this page · raw message

Signature · 1 line
1.7.10.4