linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sameo@linux.intel.com (Samuel Ortiz)
To: linux-arm-kernel@lists.infradead.org
Subject: [V1 1/3] mfd: add power control interface for pm8606 chip
Date: Thu, 23 Feb 2012 17:32:16 +0100	[thread overview]
Message-ID: <20120223163216.GL24377@sortiz-mobl> (raw)
In-Reply-To: <1329469400-8167-1-git-send-email-jtzhou@marvell.com>

Hi Jett,

On Fri, Feb 17, 2012 at 05:03:20PM +0800, Jett.Zhou wrote:
> +int pm8606_osc_enable(struct pm860x_chip *chip, unsigned short client)
> +{
> +	int ret = -EIO;
> +	struct i2c_client *i2c = (chip->id == CHIP_PM8606) ?
> +		chip->client : chip->companion;
> +
> +	dev_dbg(chip->dev, "%s(B): client=0x%x\n", __func__, client);
> +	dev_dbg(chip->dev, "%s(B): vote=0x%x status=%d\n",
> +			__func__, chip->osc_vote,
> +			chip->osc_status);
> +
> +	mutex_lock(&chip->osc_lock);
> +	/* Update voting status */
> +	chip->osc_vote |= client;
> +	/* If reference group is off - turn on*/
> +	if (chip->osc_status != PM8606_REF_GP_OSC_ON) {
> +		do {
> +			chip->osc_status =
> +				PM8606_REF_GP_OSC_UNKNOWN;
> +
> +			/* Enable Reference group Vsys */
> +			if (pm860x_set_bits(i2c, PM8606_VSYS,
> +					PM8606_VSYS_EN, PM8606_VSYS_EN))
> +				break;
> +			/*Enable Internal Oscillator */
> +			if (pm860x_set_bits(i2c, PM8606_MISC,
> +					PM8606_MISC_OSC_EN, PM8606_MISC_OSC_EN))
> +				break;
> +
> +			/* Update status (only if writes succeed) */
> +			chip->osc_status = PM8606_REF_GP_OSC_ON;
> +			ret = 0;
> +		} while (0);
Could you please remove the do {} while (0); scope ?


> +	} else
> +		ret = 0;
> +	mutex_unlock(&chip->osc_lock);
> +
> +	dev_dbg(chip->dev, "%s(A): vote=0x%x status=%d ret=%d\n",
> +			__func__, chip->osc_vote,
> +			chip->osc_status, ret);
> +	return ret;
> +}
Beside the unneeded scope, you should add more spacing in this routine. It
would look more readable.

> @@ -766,7 +867,14 @@ static void __devinit device_8607_init(struct pm860x_chip *chip,
>  out:
>  	return;
>  }
> -
Keep this one here.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

      reply	other threads:[~2012-02-23 16:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-17  9:03 [V1 1/3] mfd: add power control interface for pm8606 chip Jett.Zhou
2012-02-23 16:32 ` Samuel Ortiz [this message]

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=20120223163216.GL24377@sortiz-mobl \
    --to=sameo@linux.intel.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;
as well as URLs for NNTP newsgroup(s).