diff options
Diffstat (limited to 'include/linux/reset.h')
-rw-r--r-- | include/linux/reset.h | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/include/linux/reset.h b/include/linux/reset.h index 86b4ed75359e..13d8681210d5 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h | |||
@@ -15,6 +15,9 @@ int reset_control_status(struct reset_control *rstc); | |||
15 | struct reset_control *__of_reset_control_get(struct device_node *node, | 15 | struct reset_control *__of_reset_control_get(struct device_node *node, |
16 | const char *id, int index, bool shared, | 16 | const char *id, int index, bool shared, |
17 | bool optional); | 17 | bool optional); |
18 | struct reset_control *__reset_control_get(struct device *dev, const char *id, | ||
19 | int index, bool shared, | ||
20 | bool optional); | ||
18 | void reset_control_put(struct reset_control *rstc); | 21 | void reset_control_put(struct reset_control *rstc); |
19 | struct reset_control *__devm_reset_control_get(struct device *dev, | 22 | struct reset_control *__devm_reset_control_get(struct device *dev, |
20 | const char *id, int index, bool shared, | 23 | const char *id, int index, bool shared, |
@@ -31,31 +34,26 @@ static inline int device_reset_optional(struct device *dev) | |||
31 | 34 | ||
32 | static inline int reset_control_reset(struct reset_control *rstc) | 35 | static inline int reset_control_reset(struct reset_control *rstc) |
33 | { | 36 | { |
34 | WARN_ON(1); | ||
35 | return 0; | 37 | return 0; |
36 | } | 38 | } |
37 | 39 | ||
38 | static inline int reset_control_assert(struct reset_control *rstc) | 40 | static inline int reset_control_assert(struct reset_control *rstc) |
39 | { | 41 | { |
40 | WARN_ON(1); | ||
41 | return 0; | 42 | return 0; |
42 | } | 43 | } |
43 | 44 | ||
44 | static inline int reset_control_deassert(struct reset_control *rstc) | 45 | static inline int reset_control_deassert(struct reset_control *rstc) |
45 | { | 46 | { |
46 | WARN_ON(1); | ||
47 | return 0; | 47 | return 0; |
48 | } | 48 | } |
49 | 49 | ||
50 | static inline int reset_control_status(struct reset_control *rstc) | 50 | static inline int reset_control_status(struct reset_control *rstc) |
51 | { | 51 | { |
52 | WARN_ON(1); | ||
53 | return 0; | 52 | return 0; |
54 | } | 53 | } |
55 | 54 | ||
56 | static inline void reset_control_put(struct reset_control *rstc) | 55 | static inline void reset_control_put(struct reset_control *rstc) |
57 | { | 56 | { |
58 | WARN_ON(1); | ||
59 | } | 57 | } |
60 | 58 | ||
61 | static inline int __must_check device_reset(struct device *dev) | 59 | static inline int __must_check device_reset(struct device *dev) |
@@ -74,14 +72,21 @@ static inline struct reset_control *__of_reset_control_get( | |||
74 | const char *id, int index, bool shared, | 72 | const char *id, int index, bool shared, |
75 | bool optional) | 73 | bool optional) |
76 | { | 74 | { |
77 | return ERR_PTR(-ENOTSUPP); | 75 | return optional ? NULL : ERR_PTR(-ENOTSUPP); |
76 | } | ||
77 | |||
78 | static inline struct reset_control *__reset_control_get( | ||
79 | struct device *dev, const char *id, | ||
80 | int index, bool shared, bool optional) | ||
81 | { | ||
82 | return optional ? NULL : ERR_PTR(-ENOTSUPP); | ||
78 | } | 83 | } |
79 | 84 | ||
80 | static inline struct reset_control *__devm_reset_control_get( | 85 | static inline struct reset_control *__devm_reset_control_get( |
81 | struct device *dev, const char *id, | 86 | struct device *dev, const char *id, |
82 | int index, bool shared, bool optional) | 87 | int index, bool shared, bool optional) |
83 | { | 88 | { |
84 | return ERR_PTR(-ENOTSUPP); | 89 | return optional ? NULL : ERR_PTR(-ENOTSUPP); |
85 | } | 90 | } |
86 | 91 | ||
87 | #endif /* CONFIG_RESET_CONTROLLER */ | 92 | #endif /* CONFIG_RESET_CONTROLLER */ |
@@ -107,8 +112,7 @@ __must_check reset_control_get_exclusive(struct device *dev, const char *id) | |||
107 | #ifndef CONFIG_RESET_CONTROLLER | 112 | #ifndef CONFIG_RESET_CONTROLLER |
108 | WARN_ON(1); | 113 | WARN_ON(1); |
109 | #endif | 114 | #endif |
110 | return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, false, | 115 | return __reset_control_get(dev, id, 0, false, false); |
111 | false); | ||
112 | } | 116 | } |
113 | 117 | ||
114 | /** | 118 | /** |
@@ -136,22 +140,19 @@ __must_check reset_control_get_exclusive(struct device *dev, const char *id) | |||
136 | static inline struct reset_control *reset_control_get_shared( | 140 | static inline struct reset_control *reset_control_get_shared( |
137 | struct device *dev, const char *id) | 141 | struct device *dev, const char *id) |
138 | { | 142 | { |
139 | return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, true, | 143 | return __reset_control_get(dev, id, 0, true, false); |
140 | false); | ||
141 | } | 144 | } |
142 | 145 | ||
143 | static inline struct reset_control *reset_control_get_optional_exclusive( | 146 | static inline struct reset_control *reset_control_get_optional_exclusive( |
144 | struct device *dev, const char *id) | 147 | struct device *dev, const char *id) |
145 | { | 148 | { |
146 | return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, false, | 149 | return __reset_control_get(dev, id, 0, false, true); |
147 | true); | ||
148 | } | 150 | } |
149 | 151 | ||
150 | static inline struct reset_control *reset_control_get_optional_shared( | 152 | static inline struct reset_control *reset_control_get_optional_shared( |
151 | struct device *dev, const char *id) | 153 | struct device *dev, const char *id) |
152 | { | 154 | { |
153 | return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, true, | 155 | return __reset_control_get(dev, id, 0, true, true); |
154 | true); | ||
155 | } | 156 | } |
156 | 157 | ||
157 | /** | 158 | /** |