diff options
author | John Youn <johnyoun@synopsys.com> | 2016-05-31 19:55:01 -0400 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2016-06-01 02:21:08 -0400 |
commit | 168d7c4e8bb25c076ed8be67fcca84f5dcd0b2c6 (patch) | |
tree | e8c66ed4e5662ced238a9218826e53a6d5a80e8d /include/linux/reset.h | |
parent | 42fa905bd901e55c78ed4a69b9e2cf27a49a886b (diff) |
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")
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'include/linux/reset.h')
-rw-r--r-- | include/linux/reset.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/reset.h b/include/linux/reset.h index ec0306ce7b92..067db57c81dc 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h | |||
@@ -71,14 +71,14 @@ static inline struct reset_control *__of_reset_control_get( | |||
71 | struct device_node *node, | 71 | struct device_node *node, |
72 | const char *id, int index, int shared) | 72 | const char *id, int index, int shared) |
73 | { | 73 | { |
74 | return ERR_PTR(-EINVAL); | 74 | return ERR_PTR(-ENOTSUPP); |
75 | } | 75 | } |
76 | 76 | ||
77 | static inline struct reset_control *__devm_reset_control_get( | 77 | static inline struct reset_control *__devm_reset_control_get( |
78 | struct device *dev, | 78 | struct device *dev, |
79 | const char *id, int index, int shared) | 79 | const char *id, int index, int shared) |
80 | { | 80 | { |
81 | return ERR_PTR(-EINVAL); | 81 | return ERR_PTR(-ENOTSUPP); |
82 | } | 82 | } |
83 | 83 | ||
84 | #endif /* CONFIG_RESET_CONTROLLER */ | 84 | #endif /* CONFIG_RESET_CONTROLLER */ |