From: Daniel Ribeiro <drwyrm@gmail.com>
To: Antonio Ospite <ospite@studenti.unina.it>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Grant Likely <grant.likely@secretlab.ca>,
openezx-devel@lists.openezx.org, Chris Ball <cjb@laptop.org>,
linux-mmc@vger.kernel.org,
spi-devel-general@lists.sourceforge.net
Subject: Re: [RESEND PATCH 4/4] mmc_spi.c: add support for the regulator framework
Date: Tue, 26 Apr 2011 18:21:27 -0300 [thread overview]
Message-ID: <1303852887.2133.50.camel@laptop> (raw)
In-Reply-To: <20110421144915.93d36d12.ospite@studenti.unina.it>
[-- Attachment #1: Type: text/plain, Size: 1711 bytes --]
Em Qui, 2011-04-21 às 14:49 +0200, Antonio Ospite escreveu:
> On Thu, 21 Apr 2011 13:40:41 +0100
> Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
>
> > On Thu, Apr 21, 2011 at 02:27:53PM +0200, Antonio Ospite wrote:
> >
> > > +#ifdef CONFIG_REGULATOR
> > > + host->vcc = regulator_get(mmc_dev(host->mmc), "vmmc");
> > > +
> > > + if (IS_ERR(host->vcc)) {
> > > + host->vcc = NULL;
> > > + } else {
> > > + host->mmc->ocr_avail = mmc_regulator_get_ocrmask(host->vcc);
> > > + if (host->pdata && host->pdata->ocr_mask)
> > > + dev_warn(mmc_dev(host->mmc),
> > > + "ocr_mask/setpower will not be used\n");
> > > }
> > > +#endif
> >
> > Why is this code conditional? The regulator API will stub itself out
> > (by returning a null pointer, which plays well with your use of null) if
> > it's disabled. I'm also not seeing any corresponding code to release
> > the regulator.
> >
>
> Actually I saw this done conditionally in pxamci.c and thought it was
> really needed. About the call to regulator_put() if was there but got
> lost when squashing the commits into the final patch and I was still
> reading that part in my mind even if it was not there anymore.
> The importance of reviewers with fresh eyes.
>
> I'll resubmit this forth patch with the needed changes.
Hi,
The #ifdefs on pxamci were needed because at the time it was written
IS_ERR(regulator_get()) would return _false_ if CONFIG_REGULATOR is not
defined, breaking compatibility with the older ocr_mask/setpower.
I don't know if the regulator api changed it's old behaviour, see
http://www.mail-archive.com/openezx-devel@lists.openezx.org/msg01954.html
--
Daniel Ribeiro
[-- Attachment #2: Esta é uma parte de mensagem assinada digitalmente --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2011-04-26 21:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1300733202-27316-1-git-send-email-ospite@studenti.unina.it>
2011-04-21 12:27 ` [RESEND PATCH 0/4] mmc_spi: Add support for regulator framework Antonio Ospite
2011-04-21 12:27 ` [RESEND PATCH 1/4] mmc_spi.c: factor out the check for power capability Antonio Ospite
2011-04-21 12:27 ` [RESEND PATCH 2/4] mmc_spi.c: factor out the SD card shutdown sequence Antonio Ospite
2011-04-21 12:27 ` [RESEND PATCH 3/4] mmc_spi.c: factor out a mmc_spi_setpower() function Antonio Ospite
2011-04-21 12:27 ` [RESEND PATCH 4/4] mmc_spi.c: add support for the regulator framework Antonio Ospite
2011-04-21 12:40 ` Mark Brown
2011-04-21 12:49 ` Antonio Ospite
2011-04-26 21:21 ` Daniel Ribeiro [this message]
2011-04-22 12:43 ` [PATCH v2 " Antonio Ospite
2011-05-06 14:30 ` Antonio Ospite
2011-05-11 10:39 ` [PATCH v3] " Antonio Ospite
[not found] ` <1305110379-17218-1-git-send-email-ospite-aNJ+ML1ZbiP93QAQaVx+gl6hYfS7NtTn@public.gmane.org>
2011-05-11 13:08 ` Mark Brown
2011-05-11 20:53 ` Antonio Ospite
2011-05-11 20:57 ` Mark Brown
2011-05-18 17:23 ` Antonio Ospite
2011-05-18 19:42 ` Mark Brown
2011-05-23 15:10 ` Antonio Ospite
2011-05-30 9:07 ` Antonio Ospite
2011-05-30 10:14 ` Mark Brown
2011-05-30 10:57 ` Antonio Ospite
2011-05-31 10:05 ` 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=1303852887.2133.50.camel@laptop \
--to=drwyrm@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=cjb@laptop.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-mmc@vger.kernel.org \
--cc=openezx-devel@lists.openezx.org \
--cc=ospite@studenti.unina.it \
--cc=spi-devel-general@lists.sourceforge.net \
/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).