From: Seungwon Jeon <tgih.jun@samsung.com>
To: 'Sachin Kamat' <sachin.kamat@linaro.org>, linux-mmc@vger.kernel.org
Cc: 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, 04 Apr 2013 14:49:53 +0900 [thread overview]
Message-ID: <004401ce30f8$3afdfe70$b0f9fb50$%jun@samsung.com> (raw)
In-Reply-To: <1364444747-16777-1-git-send-email-sachin.kamat@linaro.org>
On Thursday, March 28, 2013, 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) {
Just for trivial style... if (ret) {
It looks like more simple?
> + 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) {
As above,
Thanks,
Seungwon Jeon
> + dev_err(host->dev,
> + "failed to enable regulator: %d\n", ret);
> + return ret;
> + }
> + }
>
> if (!mci_wait_reset(host->dev, host)) {
> ret = -ENODEV;
> --
> 1.7.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-04-04 5:49 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 ` [PATCH 1/2] mmc: dw_mmc: Check return value of regulator_enable Jaehoon Chung
2013-04-04 5:49 ` Seungwon Jeon [this message]
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='004401ce30f8$3afdfe70$b0f9fb50$%jun@samsung.com' \
--to=tgih.jun@samsung.com \
--cc=cjb@laptop.org \
--cc=jh80.chung@samsung.com \
--cc=linux-mmc@vger.kernel.org \
--cc=patches@linaro.org \
--cc=sachin.kamat@linaro.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