Skip to content

Commit 3c35f6e

Browse files
Lee JonespH5
authored andcommitted
reset: Reorder inline reset_control_get*() wrappers
We're about to split the current API into two, where consumers will be forced to be explicit when requesting reset lines. The choice will be to either the call the *_exclusive or *_shared variant depending on whether they can actually tolorate not being asserted when that request is made. The new API will look like this once reorded and complete: reset_control_get_exclusive() reset_control_get_shared() reset_control_get_optional_exclusive() reset_control_get_optional_shared() of_reset_control_get_exclusive() of_reset_control_get_shared() of_reset_control_get_exclusive_by_index() of_reset_control_get_shared_by_index() devm_reset_control_get_exclusive() devm_reset_control_get_shared() devm_reset_control_get_optional_exclusive() devm_reset_control_get_optional_shared() devm_reset_control_get_exclusive_by_index() devm_reset_control_get_shared_by_index() Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Philipp Zabel <[email protected]>
1 parent 1a695a9 commit 3c35f6e

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

include/linux/reset.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,6 @@ static inline struct reset_control *__must_check reset_control_get(
107107
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
108108
}
109109

110-
static inline struct reset_control *reset_control_get_optional(
111-
struct device *dev, const char *id)
112-
{
113-
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
114-
}
115-
116110
/**
117111
* reset_control_get_shared - Lookup and obtain a shared reference to a
118112
* reset controller.
@@ -141,6 +135,12 @@ static inline struct reset_control *reset_control_get_shared(
141135
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1);
142136
}
143137

138+
static inline struct reset_control *reset_control_get_optional(
139+
struct device *dev, const char *id)
140+
{
141+
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
142+
}
143+
144144
/**
145145
* of_reset_control_get - Lookup and obtain an exclusive reference to a
146146
* reset controller.
@@ -191,6 +191,21 @@ static inline struct reset_control *__must_check devm_reset_control_get(
191191
return __devm_reset_control_get(dev, id, 0, 0);
192192
}
193193

194+
/**
195+
* devm_reset_control_get_shared - resource managed reset_control_get_shared()
196+
* @dev: device to be reset by the controller
197+
* @id: reset line name
198+
*
199+
* Managed reset_control_get_shared(). For reset controllers returned from
200+
* this function, reset_control_put() is called automatically on driver detach.
201+
* See reset_control_get_shared() for more information.
202+
*/
203+
static inline struct reset_control *devm_reset_control_get_shared(
204+
struct device *dev, const char *id)
205+
{
206+
return __devm_reset_control_get(dev, id, 0, 1);
207+
}
208+
194209
static inline struct reset_control *devm_reset_control_get_optional(
195210
struct device *dev, const char *id)
196211
{
@@ -212,21 +227,6 @@ static inline struct reset_control *devm_reset_control_get_by_index(
212227
return __devm_reset_control_get(dev, NULL, index, 0);
213228
}
214229

215-
/**
216-
* devm_reset_control_get_shared - resource managed reset_control_get_shared()
217-
* @dev: device to be reset by the controller
218-
* @id: reset line name
219-
*
220-
* Managed reset_control_get_shared(). For reset controllers returned from
221-
* this function, reset_control_put() is called automatically on driver detach.
222-
* See reset_control_get_shared() for more information.
223-
*/
224-
static inline struct reset_control *devm_reset_control_get_shared(
225-
struct device *dev, const char *id)
226-
{
227-
return __devm_reset_control_get(dev, id, 0, 1);
228-
}
229-
230230
/**
231231
* devm_reset_control_get_shared_by_index - resource managed
232232
* reset_control_get_shared

0 commit comments

Comments
 (0)