Skip to content

Commit

Permalink
reset: Supply *_shared variant calls when using *_optional APIs
Browse files Browse the repository at this point in the history
Consumers need to be able to specify whether they are requesting an
'exclusive' or 'shared' reset line no matter which API (of_*, devm_*,
etc) they are using.  This change allows users of the optional_* API
in particular to specify that their request is for a 'shared' line.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
  • Loading branch information
Lee Jones authored and Philipp Zabel committed Jun 29, 2016
1 parent 40faee8 commit c33d61a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/linux/reset.h
Original file line number Diff line number Diff line change
@@ -141,6 +141,12 @@ static inline struct reset_control *reset_control_get_optional_exclusive(
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
}

static inline struct reset_control *reset_control_get_optional_shared(
struct device *dev, const char *id)
{
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1);
}

/**
* of_reset_control_get_exclusive - Lookup and obtain an exclusive reference
* to a reset controller.
@@ -270,6 +276,12 @@ static inline struct reset_control *devm_reset_control_get_optional_exclusive(
return __devm_reset_control_get(dev, id, 0, 0);
}

static inline struct reset_control *devm_reset_control_get_optional_shared(
struct device *dev, const char *id)
{
return __devm_reset_control_get(dev, id, 0, 1);
}

/**
* devm_reset_control_get_exclusive_by_index - resource managed
* reset_control_get_exclusive()

0 comments on commit c33d61a

Please sign in to comment.