linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] support PMIC mc13892
Date: Tue, 7 Dec 2010 09:02:39 +0100	[thread overview]
Message-ID: <20101207080239.GC21020@pengutronix.de> (raw)
In-Reply-To: <AANLkTi=fG_GGBO2PDDABDMoRfACLMBwxs=vKDwmAnKD7@mail.gmail.com>

Hello Yong,

On Tue, Dec 07, 2010 at 03:57:12PM +0800, Yong Shen wrote:
> 2010/12/6 Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>:
> >> + ? ? if ((val & 0x0000FFFF) == 0x45d0) {
> >> + ? ? ? ? ? ? mc13xxx_lock(mc13892);
> >> + ? ? ? ? ? ? ret = mc13xxx_reg_rmw(mc13892, MC13892_SWITCHERS4,
> >> + ? ? ? ? ? ? ? ? ? ? MC13892_SWITCHERS4_SW1MODE_M |
> >> + ? ? ? ? ? ? ? ? ? ? MC13892_SWITCHERS4_SW2MODE_M,
> >> + ? ? ? ? ? ? ? ? ? ? MC13892_SWITCHERS4_SW1MODE_AUTO |
> >> + ? ? ? ? ? ? ? ? ? ? MC13892_SWITCHERS4_SW2MODE_AUTO);
> >> + ? ? ? ? ? ? mc13xxx_unlock(mc13892);
> > It should be possible to hold the lock for longer that a single mc13xxx
> > API call. ?Your error handler just needs to unlock for that.
> I found this can not work, since regulator_register in probe function
> will in turn call regulator ops->enable or alike, which require
> mc13xxx_lock again. So we do not use long lock here.
You probably cannot only take the lock once per function, but here for
these two mc13xxx_reg_rmw it should be possible.

> >> [...]
> >> +
> >> +static struct platform_driver mc13892_regulator_driver = {
> >> + ? ? .driver = {
> >> + ? ? ? ? ? ? .name ? = "mc13892-regulator",
> >> + ? ? ? ? ? ? .owner ?= THIS_MODULE,
> >> + ? ? },
> >> + ? ? .remove ? ? ? ? = __devexit_p(mc13892_regulator_remove),
> >> + ? ? .probe ? ? ? ? ?= mc13892_regulator_probe,
> > If you ask me just use a single space before =, but there is no common
> > style visible in the kernel, so do as you prefer.
> > (The advantage of using a single space is that if later
> > .averylongmembername needs to be initialized you either have to fix
> > lines that are technically unrelated or the indention isn't uniform.)
BTW, using tabs you get a mixture, too.  Then some =s are aligned, some
don't.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2010-12-07  8:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-06  6:25 [PATCH] support PMIC mc13892 yong.shen at freescale.com
2010-12-06  7:22 ` Uwe Kleine-König
2010-12-07  2:41   ` Yong Shen
2010-12-07  7:57   ` Yong Shen
2010-12-07  8:02     ` Uwe Kleine-König [this message]
2010-12-06 10:40 ` David Jander
2010-12-07  2:50   ` Yong Shen
2010-12-06 10:55 ` Arnaud Patard (Rtp)
2010-12-06 11:42   ` Alberto Panizzo
2010-12-06 11:55     ` Arnaud Patard (Rtp)
2010-12-06 13:12       ` Alberto Panizzo
2010-12-07  2:52   ` Yong Shen
2010-12-06 21:54 ` Marc Reilly
2010-12-07  7:14   ` [PATCH] Added i2c support for mc13xxx-core Marc Reilly
2010-12-07  8:32     ` Yong Shen
2010-12-07 10:09       ` Marc Reilly
2010-12-08  6:24     ` Yong Shen
2010-12-08  8:07       ` Marc Reilly
2010-12-08 10:42         ` Uwe Kleine-König
2010-12-07  7:23   ` Marc Reilly
2010-12-07  7:23   ` Marc Reilly

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=20101207080239.GC21020@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --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).