linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Jaehoon Chung <jh80.chung@samsung.com>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	will.newton@imgtec.com, Kyungmin Park <kyungmin.park@samsung.com>,
	Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH] dw_mmc: fixed regulator control
Date: Sat, 30 Apr 2011 12:09:20 -0400	[thread overview]
Message-ID: <m3iptv2027.fsf@pullcord.laptop.org> (raw)
In-Reply-To: <4DBA90BD.8070804@samsung.com> (Jaehoon Chung's message of "Fri, 29 Apr 2011 19:19:41 +0900")

Hi Jaehoon,

On Fri, Apr 29 2011, Jaehoon Chung wrote:
> This patch fixed regulator control in dw_mmc.c
> If we didn't set CONFIG_REGULATOR, always entered error condition.
> But that's not error..because we didn't use regulator framework.
>
> So when we only used CONFIG_REGULATOR, i think that need to get regulator.
[..]
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 87e1f57..62b900f 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1441,12 +1441,14 @@ static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
>  	}
>  #endif /* CONFIG_MMC_DW_IDMAC */
>  
> +#ifdef CONFIG_REGULATOR
>  	host->vmmc = regulator_get(mmc_dev(mmc), "vmmc");
>  	if (IS_ERR(host->vmmc)) {
>  		printk(KERN_INFO "%s: no vmmc regulator found\n", mmc_hostname(mmc));
>  		host->vmmc = NULL;
>  	} else
>  		regulator_enable(host->vmmc);
> +#endif /* CONFIG_REGULATOR */
>  
>  	if (dw_mci_get_cd(mmc))
>  		set_bit(DW_MMC_CARD_PRESENT, &slot->flags);
[..]

As Lars pointed out, this doesn't make sense; without CONFIG_REGULATOR
host->vmmc becomes NULL, which isn't IS_ERR.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

  reply	other threads:[~2011-04-30 16:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-29 10:19 [PATCH] dw_mmc: fixed regulator control Jaehoon Chung
2011-04-30 16:09 ` Chris Ball [this message]
2011-05-02  7:53   ` Jaehoon Chung
2011-05-11  1:23     ` Chris Ball
2011-05-11  3:00       ` Jaehoon Chung

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=m3iptv2027.fsf@pullcord.laptop.org \
    --to=cjb@laptop.org \
    --cc=jh80.chung@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=lars@metafoo.de \
    --cc=linux-mmc@vger.kernel.org \
    --cc=will.newton@imgtec.com \
    /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).