Skip to contentSkip to conversation

reset: Add (devm_)reset_control_get stub functions

PATCH Superseded Axel Lin 3 participants 3 messages Aug 31, 2015 Reset controller framework

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 reset: Add (devm_)reset_control_get stub functions

So the drivers can be compiled with CONFIG_RESET_CONTROLLER disabled.

---
 include/linux/reset.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
include/linux/reset.h +12 -0
index da5602b..cd42c1b 100644
@@ -74,6 +74,18 @@ static inline int device_reset_optional(struct device *dev)
 	return -ENOSYS;
 }
 
+static inline struct reset_control *reset_control_get(
+					struct device *dev, const char *id)
+{
+	return ERR_PTR(-ENOSYS);
+}
+
+static inline struct reset_control *devm_reset_control_get(
+					struct device *dev, const char *id)
+{
+	return ERR_PTR(-ENOSYS);
+}
+
 static inline struct reset_control *reset_control_get_optional(
 					struct device *dev, const char *id)
 {
Signature · 1 line
2.1.0
#1 lore raw
Quoted 1 line · Axel Lin

So the drivers can be compiled with CONFIG_RESET_CONTROLLER disabled.

The lack of this is breaking the build for the newly added ASoC STI driver in some COMPILE_TEST configurations, can we please get this in for v4.3-rc1?

maintainer
#2 lore raw
In reply to Axel Lin

Hi Axel,

thank you for the patch.

Am Montag, den 31.08.2015, 17:22 +0800 schrieb Axel Lin:

Quoted 17 lines

So the drivers can be compiled with CONFIG_RESET_CONTROLLER disabled.

---
 include/linux/reset.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
include/linux/reset.h +2 -0
index da5602b..cd42c1b 100644
@@ -74,6 +74,18 @@ static inline int device_reset_optional(struct device *dev)
 	return -ENOSYS;
 }
 
+static inline struct reset_control *reset_control_get(
+					struct device *dev, const char *id)

include/linux/reset.h static inline int device_reset_optional(struct device *dev) · line 88

Quoted 10 lines
include/linux/reset.h +10 -0
+{
+	return ERR_PTR(-ENOSYS);
+}
+
+static inline struct reset_control *devm_reset_control_get(
+					struct device *dev, const char *id)
+{
+	return ERR_PTR(-ENOSYS);
+}
+

Could you add a WARN_ON(1) to both, make them __must_check, and return something other than -ENOSYS. For example the gpio stubs return -EINVAL.

regards
Philipp