Skip to contentSkip to conversation

reset: Return -ENOTSUPP when not configured

PATCH New John Youn 2 participants 2 messages May 31, 2016 – Jun 1, 2016 Reset controller framework

lore
Share & tools
lore

John Youn

author
#0 lore raw

PATCH v2 1/1 reset: Return -ENOTSUPP when not configured

Prior to commit 6c96f05c8bb8 ("reset: Make [of_]reset_control_get[_foo] functions wrappers"), the "optional" functions returned -ENOTSUPP when CONFIG_RESET_CONTROLLER was not set.

Revert back to the old behavior by changing the new __devm_reset_control_get() and __of_reset_control_get() functions to return ERR_PTR(-ENOTSUPP) when compiled without CONFIG_RESET_CONTROLLER.

Otherwise they will return -EINVAL causing users to think that an error occurred when CONFIG_RESET_CONTROLLER is not set.

Fixes 6c96f05c8bb8 ("reset: Make [of_]reset_control_get[_foo] functions wrappers")

---

Hi Philipp,

Here are the changes as discussed previously. It just returns -ENOTSUPP directly when not configured. Tested and works with DWC2 driver with Dinh's patch that adds the reset controller, using a configuration with no reset controller configured.

v2:
* Return ERR_PTR(-ENOTSUPP) directly.

 include/linux/reset.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/reset.h +2 -2
index ec0306ce..067db57 100644
@@ -71,14 +71,14 @@ static inline struct reset_control *__of_reset_control_get(
 					struct device_node *node,
 					const char *id, int index, int shared)
 {
-	return ERR_PTR(-EINVAL);
+	return ERR_PTR(-ENOTSUPP);
 }
 
 static inline struct reset_control *__devm_reset_control_get(
 					struct device *dev,
 					const char *id, int index, int shared)
 {
-	return ERR_PTR(-EINVAL);
+	return ERR_PTR(-ENOTSUPP);
 }
 
 #endif /* CONFIG_RESET_CONTROLLER */
Signature · 1 line
2.8.2
maintainer
#1 lore raw

PATCH v2 1/1 reset: Return -ENOTSUPP when not configured

Hi John,

Am Dienstag, den 31.05.2016, 16:55 -0700 schrieb John Youn:

Quoted 13 lines

Prior to commit 6c96f05c8bb8 ("reset: Make [of_]reset_control_get[_foo] functions wrappers"), the "optional" functions returned -ENOTSUPP when CONFIG_RESET_CONTROLLER was not set.

Revert back to the old behavior by changing the new __devm_reset_control_get() and __of_reset_control_get() functions to return ERR_PTR(-ENOTSUPP) when compiled without CONFIG_RESET_CONTROLLER.

Otherwise they will return -EINVAL causing users to think that an error occurred when CONFIG_RESET_CONTROLLER is not set.

Fixes 6c96f05c8bb8 ("reset: Make [of_]reset_control_get[_foo] functions wrappers")
Quoted 8 lines

---

Hi Philipp,

Here are the changes as discussed previously. It just returns -ENOTSUPP directly when not configured. Tested and works with DWC2 driver with Dinh's patch that adds the reset controller, using a configuration with no reset controller configured.

Thank you, I've applied the patch to my reset/next branch.

regards
Philipp