提交 3c35f6ed 编写于 作者: L Lee Jones 提交者: Philipp Zabel

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: NLee Jones <lee.jones@linaro.org>
Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de>
上级 1a695a90
...@@ -107,12 +107,6 @@ static inline struct reset_control *__must_check reset_control_get( ...@@ -107,12 +107,6 @@ static inline struct reset_control *__must_check reset_control_get(
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0); return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
} }
static inline struct reset_control *reset_control_get_optional(
struct device *dev, const char *id)
{
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
}
/** /**
* reset_control_get_shared - Lookup and obtain a shared reference to a * reset_control_get_shared - Lookup and obtain a shared reference to a
* reset controller. * reset controller.
...@@ -141,6 +135,12 @@ static inline struct reset_control *reset_control_get_shared( ...@@ -141,6 +135,12 @@ static inline struct reset_control *reset_control_get_shared(
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1); return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1);
} }
static inline struct reset_control *reset_control_get_optional(
struct device *dev, const char *id)
{
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
}
/** /**
* of_reset_control_get - Lookup and obtain an exclusive reference to a * of_reset_control_get - Lookup and obtain an exclusive reference to a
* reset controller. * reset controller.
...@@ -191,6 +191,21 @@ static inline struct reset_control *__must_check devm_reset_control_get( ...@@ -191,6 +191,21 @@ static inline struct reset_control *__must_check devm_reset_control_get(
return __devm_reset_control_get(dev, id, 0, 0); return __devm_reset_control_get(dev, id, 0, 0);
} }
/**
* devm_reset_control_get_shared - resource managed reset_control_get_shared()
* @dev: device to be reset by the controller
* @id: reset line name
*
* Managed reset_control_get_shared(). For reset controllers returned from
* this function, reset_control_put() is called automatically on driver detach.
* See reset_control_get_shared() for more information.
*/
static inline struct reset_control *devm_reset_control_get_shared(
struct device *dev, const char *id)
{
return __devm_reset_control_get(dev, id, 0, 1);
}
static inline struct reset_control *devm_reset_control_get_optional( static inline struct reset_control *devm_reset_control_get_optional(
struct device *dev, const char *id) struct device *dev, const char *id)
{ {
...@@ -212,21 +227,6 @@ static inline struct reset_control *devm_reset_control_get_by_index( ...@@ -212,21 +227,6 @@ static inline struct reset_control *devm_reset_control_get_by_index(
return __devm_reset_control_get(dev, NULL, index, 0); return __devm_reset_control_get(dev, NULL, index, 0);
} }
/**
* devm_reset_control_get_shared - resource managed reset_control_get_shared()
* @dev: device to be reset by the controller
* @id: reset line name
*
* Managed reset_control_get_shared(). For reset controllers returned from
* this function, reset_control_put() is called automatically on driver detach.
* See reset_control_get_shared() for more information.
*/
static inline struct reset_control *devm_reset_control_get_shared(
struct device *dev, const char *id)
{
return __devm_reset_control_get(dev, id, 0, 1);
}
/** /**
* devm_reset_control_get_shared_by_index - resource managed * devm_reset_control_get_shared_by_index - resource managed
* reset_control_get_shared * reset_control_get_shared
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册