From: Jaehoon Chung <jh80.chung@samsung.com>
To: Sachin Kamat <sachin.kamat@linaro.org>
Cc: linux-mmc@vger.kernel.org, tgih.jun@samsung.com,
jh80.chung@samsung.com, cjb@laptop.org, patches@linaro.org
Subject: Re: [PATCH 1/2] mmc: dw_mmc: Check return value of regulator_enable
Date: Thu, 28 Mar 2013 13:42:23 +0900 [thread overview]
Message-ID: <5153CA2F.5030303@samsung.com> (raw)
In-Reply-To: <1364444747-16777-1-git-send-email-sachin.kamat@linaro.org>
Hi, Sachin
Your patch is right. I want to use the mmc_regulator_set_ocr() into core.c.
Then I think we can remove the regulator_enable/disable in suspend/resume.
how about this? If you have any opinion, let me know.
Anyway, this patch looks good to me. Thanks for your effort.
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Best Regards,
Jaehoon Chung
On 03/28/2013 01:25 PM, Sachin Kamat wrote:
> regulator_enable() is declared with __must_check attribute.
> Hence check the return value to ensure that the regulator is enabled.
> Fixes the following warning:
> drivers/mmc/host/dw_mmc.c:2461:19: warning:
> ignoring return value of ‘regulator_enable’, declared with attribute
> warn_unused_result [-Wunused-result]
> drivers/mmc/host/dw_mmc.c: In function ‘dw_mci_init_slot’:
> drivers/mmc/host/dw_mmc.c:1994:19: warning:
> ignoring return value of ‘regulator_enable’, declared with attribute
> warn_unused_result [-Wunused-result]
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> drivers/mmc/host/dw_mmc.c | 20 ++++++++++++++++----
> 1 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index a443820..1ba09d0 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1990,8 +1990,14 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
> if (IS_ERR(host->vmmc)) {
> pr_info("%s: no vmmc regulator found\n", mmc_hostname(mmc));
> host->vmmc = NULL;
> - } else
> - regulator_enable(host->vmmc);
> + } else {
> + ret = regulator_enable(host->vmmc);
> + if (ret != 0) {
> + dev_err(host->dev,
> + "failed to enable regulator: %d\n", ret);
> + goto err_setup_bus;
> + }
> + }
>
> if (dw_mci_get_cd(mmc))
> set_bit(DW_MMC_CARD_PRESENT, &slot->flags);
> @@ -2457,8 +2463,14 @@ int dw_mci_resume(struct dw_mci *host)
> {
> int i, ret;
>
> - if (host->vmmc)
> - regulator_enable(host->vmmc);
> + if (host->vmmc) {
> + ret = regulator_enable(host->vmmc);
> + if (ret != 0) {
> + dev_err(host->dev,
> + "failed to enable regulator: %d\n", ret);
> + return ret;
> + }
> + }
>
> if (!mci_wait_reset(host->dev, host)) {
> ret = -ENODEV;
>
next prev parent reply other threads:[~2013-03-28 4:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-28 4:25 [PATCH 1/2] mmc: dw_mmc: Check return value of regulator_enable Sachin Kamat
2013-03-28 4:25 ` [PATCH 2/2] mmc: dw_mmc: Use pr_info instead of printk Sachin Kamat
2013-03-28 4:47 ` Jaehoon Chung
2013-03-28 4:42 ` Jaehoon Chung [this message]
2013-04-04 5:49 ` [PATCH 1/2] mmc: dw_mmc: Check return value of regulator_enable Seungwon Jeon
2013-04-04 5:56 ` Sachin Kamat
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=5153CA2F.5030303@samsung.com \
--to=jh80.chung@samsung.com \
--cc=cjb@laptop.org \
--cc=linux-mmc@vger.kernel.org \
--cc=patches@linaro.org \
--cc=sachin.kamat@linaro.org \
--cc=tgih.jun@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.