public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: David Woodhouse <dwmw2@infradead.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] power_supply: pda_power: Complain if regulator operations fail
Date: Sun, 17 Jun 2012 21:35:26 -0700	[thread overview]
Message-ID: <20120618043526.GB25372@lizard> (raw)
In-Reply-To: <1339465586-10841-1-git-send-email-broonie@opensource.wolfsonmicro.com>

On Tue, Jun 12, 2012 at 09:46:26AM +0800, Mark Brown wrote:
> Rather than silently ignoring errors from the regulator enable and disable
> add a WARN_ON() - it's probably pretty important if we're not getting
> power, though it should be vanishingly unlikely in production.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---

Applied, thanks!

>  drivers/power/pda_power.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c
> index 214468f..ed54a35 100644
> --- a/drivers/power/pda_power.c
> +++ b/drivers/power/pda_power.c
> @@ -134,13 +134,13 @@ static void update_charger(void)
>  			regulator_set_current_limit(ac_draw, max_uA, max_uA);
>  			if (!regulator_enabled) {
>  				dev_dbg(dev, "charger on (AC)\n");
> -				regulator_enable(ac_draw);
> +				WARN_ON(regulator_enable(ac_draw));
>  				regulator_enabled = 1;
>  			}
>  		} else {
>  			if (regulator_enabled) {
>  				dev_dbg(dev, "charger off\n");
> -				regulator_disable(ac_draw);
> +				WARN_ON(regulator_disable(ac_draw));
>  				regulator_enabled = 0;
>  			}
>  		}
> -- 
> 1.7.10

-- 
Anton Vorontsov
Email: cbouatmailru@gmail.com

  reply	other threads:[~2012-06-18  4:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12  1:46 [PATCH] power_supply: pda_power: Complain if regulator operations fail Mark Brown
2012-06-18  4:35 ` Anton Vorontsov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-05-07 17:21 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=20120618043526.GB25372@lizard \
    --to=cbouatmailru@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /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