@@ -84,8 +84,8 @@ static inline struct reset_control *__devm_reset_control_get(
84
84
#endif /* CONFIG_RESET_CONTROLLER */
85
85
86
86
/**
87
- * reset_control_get - Lookup and obtain an exclusive reference to a
88
- * reset controller.
87
+ * reset_control_get_exclusive - Lookup and obtain an exclusive reference
88
+ * to a reset controller.
89
89
* @dev: device to be reset by the controller
90
90
* @id: reset line name
91
91
*
@@ -98,8 +98,8 @@ static inline struct reset_control *__devm_reset_control_get(
98
98
*
99
99
* Use of id names is optional.
100
100
*/
101
- static inline struct reset_control * __must_check reset_control_get (
102
- struct device * dev , const char * id )
101
+ static inline struct reset_control *
102
+ __must_check reset_control_get_exclusive ( struct device * dev , const char * id )
103
103
{
104
104
#ifndef CONFIG_RESET_CONTROLLER
105
105
WARN_ON (1 );
@@ -135,55 +135,60 @@ static inline struct reset_control *reset_control_get_shared(
135
135
return __of_reset_control_get (dev ? dev -> of_node : NULL , id , 0 , 1 );
136
136
}
137
137
138
- static inline struct reset_control * reset_control_get_optional (
138
+ static inline struct reset_control * reset_control_get_optional_exclusive (
139
139
struct device * dev , const char * id )
140
140
{
141
141
return __of_reset_control_get (dev ? dev -> of_node : NULL , id , 0 , 0 );
142
142
}
143
143
144
144
/**
145
- * of_reset_control_get - Lookup and obtain an exclusive reference to a
146
- * reset controller.
145
+ * of_reset_control_get_exclusive - Lookup and obtain an exclusive reference
146
+ * to a reset controller.
147
147
* @node: device to be reset by the controller
148
148
* @id: reset line name
149
149
*
150
150
* Returns a struct reset_control or IS_ERR() condition containing errno.
151
151
*
152
152
* Use of id names is optional.
153
153
*/
154
- static inline struct reset_control * of_reset_control_get (
154
+ static inline struct reset_control * of_reset_control_get_exclusive (
155
155
struct device_node * node , const char * id )
156
156
{
157
157
return __of_reset_control_get (node , id , 0 , 0 );
158
158
}
159
159
160
160
/**
161
- * of_reset_control_get_by_index - Lookup and obtain an exclusive reference to
162
- * a reset controller by index.
161
+ * of_reset_control_get_exclusive_by_index - Lookup and obtain an exclusive
162
+ * reference to a reset controller
163
+ * by index.
163
164
* @node: device to be reset by the controller
164
165
* @index: index of the reset controller
165
166
*
166
167
* This is to be used to perform a list of resets for a device or power domain
167
168
* in whatever order. Returns a struct reset_control or IS_ERR() condition
168
169
* containing errno.
169
170
*/
170
- static inline struct reset_control * of_reset_control_get_by_index (
171
+ static inline struct reset_control * of_reset_control_get_exclusive_by_index (
171
172
struct device_node * node , int index )
172
173
{
173
174
return __of_reset_control_get (node , NULL , index , 0 );
174
175
}
175
176
176
177
/**
177
- * devm_reset_control_get - resource managed reset_control_get()
178
+ * devm_reset_control_get_exclusive - resource managed
179
+ * reset_control_get_exclusive()
178
180
* @dev: device to be reset by the controller
179
181
* @id: reset line name
180
182
*
181
- * Managed reset_control_get(). For reset controllers returned from this
182
- * function, reset_control_put() is called automatically on driver detach.
183
- * See reset_control_get() for more information.
183
+ * Managed reset_control_get_exclusive(). For reset controllers returned
184
+ * from this function, reset_control_put() is called automatically on driver
185
+ * detach.
186
+ *
187
+ * See reset_control_get_exclusive() for more information.
184
188
*/
185
- static inline struct reset_control * __must_check devm_reset_control_get (
186
- struct device * dev , const char * id )
189
+ static inline struct reset_control *
190
+ __must_check devm_reset_control_get_exclusive (struct device * dev ,
191
+ const char * id )
187
192
{
188
193
#ifndef CONFIG_RESET_CONTROLLER
189
194
WARN_ON (1 );
@@ -206,23 +211,26 @@ static inline struct reset_control *devm_reset_control_get_shared(
206
211
return __devm_reset_control_get (dev , id , 0 , 1 );
207
212
}
208
213
209
- static inline struct reset_control * devm_reset_control_get_optional (
214
+ static inline struct reset_control * devm_reset_control_get_optional_exclusive (
210
215
struct device * dev , const char * id )
211
216
{
212
217
return __devm_reset_control_get (dev , id , 0 , 0 );
213
218
}
214
219
215
220
/**
216
- * devm_reset_control_get_by_index - resource managed reset_control_get
221
+ * devm_reset_control_get_exclusive_by_index - resource managed
222
+ * reset_control_get_exclusive()
217
223
* @dev: device to be reset by the controller
218
224
* @index: index of the reset controller
219
225
*
220
- * Managed reset_control_get(). For reset controllers returned from this
221
- * function, reset_control_put() is called automatically on driver detach.
222
- * See reset_control_get() for more information.
226
+ * Managed reset_control_get_exclusive(). For reset controllers returned from
227
+ * this function, reset_control_put() is called automatically on driver
228
+ * detach.
229
+ *
230
+ * See reset_control_get_exclusive() for more information.
223
231
*/
224
- static inline struct reset_control * devm_reset_control_get_by_index (
225
- struct device * dev , int index )
232
+ static inline struct reset_control *
233
+ devm_reset_control_get_exclusive_by_index ( struct device * dev , int index )
226
234
{
227
235
return __devm_reset_control_get (dev , NULL , index , 0 );
228
236
}
@@ -243,4 +251,54 @@ static inline struct reset_control *devm_reset_control_get_shared_by_index(
243
251
return __devm_reset_control_get (dev , NULL , index , 1 );
244
252
}
245
253
254
+ /*
255
+ * TEMPORARY calls to use during transition:
256
+ *
257
+ * of_reset_control_get() => of_reset_control_get_exclusive()
258
+ *
259
+ * These inline function calls will be removed once all consumers
260
+ * have been moved over to the new explicit API.
261
+ */
262
+ static inline struct reset_control * reset_control_get (
263
+ struct device * dev , const char * id )
264
+ {
265
+ return reset_control_get_exclusive (dev , id );
266
+ }
267
+
268
+ static inline struct reset_control * reset_control_get_optional (
269
+ struct device * dev , const char * id )
270
+ {
271
+ return reset_control_get_optional_exclusive (dev , id );
272
+ }
273
+
274
+ static inline struct reset_control * of_reset_control_get (
275
+ struct device_node * node , const char * id )
276
+ {
277
+ return of_reset_control_get_exclusive (node , id );
278
+ }
279
+
280
+ static inline struct reset_control * of_reset_control_get_by_index (
281
+ struct device_node * node , int index )
282
+ {
283
+ return of_reset_control_get_exclusive_by_index (node , index );
284
+ }
285
+
286
+ static inline struct reset_control * devm_reset_control_get (
287
+ struct device * dev , const char * id )
288
+ {
289
+ return devm_reset_control_get_exclusive (dev , id );
290
+ }
291
+
292
+ static inline struct reset_control * devm_reset_control_get_optional (
293
+ struct device * dev , const char * id )
294
+ {
295
+ return devm_reset_control_get_optional_exclusive (dev , id );
296
+
297
+ }
298
+
299
+ static inline struct reset_control * devm_reset_control_get_by_index (
300
+ struct device * dev , int index )
301
+ {
302
+ return devm_reset_control_get_exclusive_by_index (dev , index );
303
+ }
246
304
#endif
0 commit comments