diff mbox

[4/7] reset: Supply *_shared variant calls when using *_optional APIs

Message ID 20160606155655.10860-5-lee.jones@linaro.org
State Accepted
Commit c33d61a0c400c50f378ef03a386e646abca292ca
Headers show

Commit Message

Lee Jones June 6, 2016, 3:56 p.m. UTC
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>

---
 include/linux/reset.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

-- 
2.8.3

Comments

Lee Jones June 28, 2016, 8:56 a.m. UTC | #1
Philipp,

I need this to go into the -rcs too.

Can I add it with your Ack please?

> 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>

> ---

>  include/linux/reset.h | 12 ++++++++++++

>  1 file changed, 12 insertions(+)

> 

> diff --git a/include/linux/reset.h b/include/linux/reset.h

> index fd69240..c358106 100644

> --- a/include/linux/reset.h

> +++ b/include/linux/reset.h

> @@ -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()


-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Lee Jones June 29, 2016, 8:06 a.m. UTC | #2
On Wed, 29 Jun 2016, Philipp Zabel wrote:
> Am Dienstag, den 28.06.2016, 09:56 +0100 schrieb Lee Jones:

> > Philipp,

> > 

> > I need this to go into the -rcs too.

> > 

> > Can I add it with your Ack please?

> 

> I have already added your patches to my branch, and I intend to send a

> pull request for it tomorrow. I am afraid applying this patch in another

> branch would create a merge conflict with

> git://git.pengutronix.de/git/pza/linux.git reset/next

> in arm-soc. If that is not the case, go ahead. Otherwise I could provide

> a tag at commit 2485394d9e0b ("reset: TRIVIAL: Add line break at same

> place for similar APIs") for you to merge.


Yes please.  If you could tag a branch containing commit:

  reset: Supply *_shared variant calls when using *_optional APIs

... that would be perfect.  Would you mind sending me the tag name
ASAP please, since I am ready to send my pull-request to Linus.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
diff mbox

Patch

diff --git a/include/linux/reset.h b/include/linux/reset.h
index fd69240..c358106 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -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()