public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Mattias Wallin <mattias.wallin@stericsson.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: regulator disable supply fix
Date: Tue, 2 Nov 2010 09:19:52 -0400	[thread overview]
Message-ID: <20101102131952.GC21476@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1288700549-28535-1-git-send-email-mattias.wallin@stericsson.com>

On Tue, Nov 02, 2010 at 01:22:29PM +0100, Mattias Wallin wrote:
> This patch fixes a disable failure when regulator supply is used.
> A while loop in regulator disable checks for supply pointer != NULL
> but the pointer is not always updated, resulting in the while loop
> running too many times causing a disable failure.

> Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com>

Hrm.  This does fix the problem which is needed so:

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

> ---
>  drivers/regulator/core.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
> index f1d10c9..dc7d36e 100644
> --- a/drivers/regulator/core.c
> +++ b/drivers/regulator/core.c
> @@ -1424,6 +1424,7 @@ int regulator_disable(struct regulator *regulator)
>  	/* decrease our supplies ref count and disable if required */
>  	while (supply_rdev != NULL) {
>  		rdev = supply_rdev;
> +		supply_rdev = NULL;
>  
>  		mutex_lock(&rdev->mutex);
>  		_regulator_disable(rdev, &supply_rdev);

but this does smell a bit like it ought to be in the _regulator_disable()
call rather than the caller.

  reply	other threads:[~2010-11-02 13:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-02 12:22 [PATCH] regulator: regulator disable supply fix Mattias Wallin
2010-11-02 13:19 ` Mark Brown [this message]
2010-11-02 13:45   ` Mattias Wallin
2010-11-02 13:46     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101102131952.GC21476@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=mattias.wallin@stericsson.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox