Skip to contentSkip to conversation

reset: Provide !RESET_CONTROLLER stub for devm_reset_control_get()

PATCH In review Mark Brown 2 participants 2 messages Aug 1, 2014 – Aug 4, 2014 Reset controller framework

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 reset: Provide !RESET_CONTROLLER stub for devm_reset_control_get()

From: Mark Brown <[email protected]>

At least the sun6i DMA controller driver makes use of the reset controller API stubs when being built for coverage and otherwise fails to build.

---
 include/linux/reset.h | 7 +++++++
 1 file changed, 7 insertions(+)
include/linux/reset.h +7 -0
index 349f150..28f119f 100644
@@ -67,6 +67,13 @@ static inline int device_reset_optional(struct device *dev)
 	return -ENOSYS;
 }
 
+static inline struct reset_control *devm_reset_control_get(struct device *dev,
+							   const char *id)
+{
+	WARN_ON(1);
+	return ERR_PTR(-ENOSYS);
+}
+
 static inline struct reset_control *reset_control_get_optional(
 					struct device *dev, const char *id)
 {
Signature · 1 line
2.0.0
maintainer
#1 lore raw

Hi Mark,

Am Freitag, den 01.08.2014, 18:11 +0100 schrieb Mark Brown:

Quoted 15 lines

From: Mark Brown <[email protected]>

At least the sun6i DMA controller driver makes use of the reset controller API stubs when being built for coverage and otherwise fails to build.

---
 include/linux/reset.h | 7 +++++++
 1 file changed, 7 insertions(+)
include/linux/reset.h +0 -0
index 349f150..28f119f 100644

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

Quoted 10 lines
include/linux/reset.h +7 -0
@@ -67,6 +67,13 @@ static inline int device_reset_optional(struct device *dev)
 	return -ENOSYS;
 }
 
+static inline struct reset_control *devm_reset_control_get(struct device *dev,
+							   const char *id)
+{
+	WARN_ON(1);
+	return ERR_PTR(-ENOSYS);
+}
+

I'd prefer to keep devm_reset_control_get without a stub. Drivers that can be built without CONFIG_RESET_CONTROLLER enabled should use devm_reset_control_get_optional, and this way the build tests already report this issue.

regards
Philipp