diff mbox

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

Message ID 20160606155655.10860-5-lee.jones@linaro.org (mailing list archive)
State New, archived
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(+)

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()
Philipp Zabel June 29, 2016, 7:48 a.m. UTC | #2
Hi Lee,

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.

regards
Philipp
Lee Jones June 29, 2016, 8:06 a.m. UTC | #3
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.
Philipp Zabel June 29, 2016, 9:23 a.m. UTC | #4
Am Mittwoch, den 29.06.2016, 09:06 +0100 schrieb Lee Jones:
> 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.

git://git.pengutronix.de/git/pza/linux.git tags/reset-shared-optional

regards
Philipp
Lee Jones June 29, 2016, 9:37 a.m. UTC | #5
On Wed, 29 Jun 2016, Philipp Zabel wrote:

> Am Mittwoch, den 29.06.2016, 09:06 +0100 schrieb Lee Jones:
> > 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.
> 
> git://git.pengutronix.de/git/pza/linux.git tags/reset-shared-optional

Ah!  If I rebase on that tag, I will also take in all of the patches
between it and v4.7-rc1, which is 14 commits.  Is there any way you
can place it onto it's own branch, then we both merge it into our
respective trees?
Philipp Zabel June 29, 2016, 9:57 p.m. UTC | #6
Hi Lee,

On Wed, Jun 29, 2016 at 10:37:34AM +0100, Lee Jones wrote:
[...]
> > > > 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.
> > 
> > git://git.pengutronix.de/git/pza/linux.git tags/reset-shared-optional
> 
> Ah!  If I rebase on that tag, I will also take in all of the patches
> between it and v4.7-rc1, which is 14 commits.  Is there any way you
> can place it onto it's own branch, then we both merge it into our
> respective trees?

I have now moved your patches into their own branch at
git://git.pengutronix.de/git/pza/linux.git tags/reset-explicit-api
and merged that back in.

regards
Philipp
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()