public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2] support PMIC mc13892
Date: Tue, 7 Dec 2010 14:48:19 +0000	[thread overview]
Message-ID: <20101207144818.GB9689@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <1291708905-23645-1-git-send-email-b00984@freescale.com>

On Tue, Dec 07, 2010 at 04:01:45PM +0800, b00984 at freescale.com wrote:

> +	mc13xxx_lock(priv->mc13xxx);
> +	ret = mc13xxx_reg_read(priv->mc13xxx,
> +				mc13892_regulators[id].vsel_reg, &val);
> +	mc13xxx_unlock(priv->mc13xxx);
> +	if (ret)
> +		return ret;
> +
> +	hi  = val & MC13892_SWITCHERS0_SWxHI;
> +	if (value > 1375)
> +		hi = 1;
> +	if (value < 1100)
> +		hi = 0;
> +
> +	if (hi) {
> +		value = (value - 1100000) / 25000;
> +		value |= MC13892_SWITCHERS0_SWxHI;
> +	} else
> +		value = (value - 600000) / 25000;
> +
> +	mask = mc13892_regulators[id].vsel_mask | MC13892_SWITCHERS0_SWxHI;
> +	mc13xxx_lock(priv->mc13xxx);
> +	ret = mc13xxx_reg_rmw(priv->mc13xxx, mc13892_regulators[id].vsel_reg,
> +			mask,
> +			value << mc13892_regulators[id].vsel_shift);
> +	mc13xxx_unlock(priv->mc13xxx);

This section here reads like it's all one big read/modify/write cycle
and therefore the mutex ought to be held throughout?  

Otherwise the patch looks good.

  parent reply	other threads:[~2010-12-07 14:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-07  8:01 [PATCHv2] support PMIC mc13892 b00984 at freescale.com
2010-12-07  9:39 ` Arnaud Patard (Rtp)
2010-12-07  9:43   ` Uwe Kleine-König
2010-12-07  9:55   ` Yong Shen
2010-12-07 11:54     ` Mark Brown
2010-12-07 14:48 ` Mark Brown [this message]
2010-12-08  3:19   ` Yong Shen

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=20101207144818.GB9689@rakim.wolfsonmicro.main \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-arm-kernel@lists.infradead.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