From: Chris Ball <cjb@laptop.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org,
Stephen Warren <swarren@wwwdotorg.org>,
linux-arm-kernel@lists.infradead.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Linus Walleij <linus.walleij@linaro.org>,
Axel Lin <axel.lin@ingics.com>, Jingoo Han <jg1.han@samsung.com>,
Felipe Balbi <balbi@ti.com>, Dmitry Torokhov <dtor@mail.ru>,
linux-mmc@vger.kernel.org
Subject: Re: Regulator API ignored return values
Date: Mon, 11 Mar 2013 17:55:39 -0400 [thread overview]
Message-ID: <87a9q9iotg.fsf@octavius.laptop.org> (raw)
In-Reply-To: <201303112043.53334.arnd@arndb.de> (Arnd Bergmann's message of "Mon, 11 Mar 2013 20:43:53 +0000")
Hi,
On Mon, Mar 11 2013, Arnd Bergmann wrote:
> ==> build/dove_defconfig/faillog <==
> /git/arm-soc/drivers/mmc/host/sdhci.c: In function 'sdhci_add_host':
> /git/arm-soc/drivers/mmc/host/sdhci.c:2910:19: warning: ignoring
> return value of 'regulator_enable', declared with attribute
> warn_unused_result [-Wunused-result]
Thanks, this looks like the right fix to me:
Subject: [PATCH] mmc: sdhci: Don't ignore regulator_enable() return value
Fixes:
/git/arm-soc/drivers/mmc/host/sdhci.c: In function 'sdhci_add_host':
/git/arm-soc/drivers/mmc/host/sdhci.c:2910:19: warning: ignoring
return value of 'regulator_enable', declared with attribute
warn_unused_result [-Wunused-result]
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
---
drivers/mmc/host/sdhci.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 51bbba4..fbf0b93 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2907,12 +2907,17 @@ int sdhci_add_host(struct sdhci_host *host)
host->vqmmc = NULL;
}
} else {
- regulator_enable(host->vqmmc);
+ ret = regulator_enable(host->vqmmc);
if (!regulator_is_supported_voltage(host->vqmmc, 1700000,
1950000))
caps[1] &= ~(SDHCI_SUPPORT_SDR104 |
SDHCI_SUPPORT_SDR50 |
SDHCI_SUPPORT_DDR50);
+ if (ret) {
+ pr_warn("%s: Failed to enable vqmmc regulator: %d\n",
+ mmc_hostname(mmc), ret);
+ host->vqmmc = NULL;
+ }
}
if (host->quirks2 & SDHCI_QUIRK2_NO_1_8_V)
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
WARNING: multiple messages have this Message-ID (diff)
From: cjb@laptop.org (Chris Ball)
To: linux-arm-kernel@lists.infradead.org
Subject: Regulator API ignored return values
Date: Mon, 11 Mar 2013 17:55:39 -0400 [thread overview]
Message-ID: <87a9q9iotg.fsf@octavius.laptop.org> (raw)
In-Reply-To: <201303112043.53334.arnd@arndb.de> (Arnd Bergmann's message of "Mon, 11 Mar 2013 20:43:53 +0000")
Hi,
On Mon, Mar 11 2013, Arnd Bergmann wrote:
> ==> build/dove_defconfig/faillog <==
> /git/arm-soc/drivers/mmc/host/sdhci.c: In function 'sdhci_add_host':
> /git/arm-soc/drivers/mmc/host/sdhci.c:2910:19: warning: ignoring
> return value of 'regulator_enable', declared with attribute
> warn_unused_result [-Wunused-result]
Thanks, this looks like the right fix to me:
Subject: [PATCH] mmc: sdhci: Don't ignore regulator_enable() return value
Fixes:
/git/arm-soc/drivers/mmc/host/sdhci.c: In function 'sdhci_add_host':
/git/arm-soc/drivers/mmc/host/sdhci.c:2910:19: warning: ignoring
return value of 'regulator_enable', declared with attribute
warn_unused_result [-Wunused-result]
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
---
drivers/mmc/host/sdhci.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 51bbba4..fbf0b93 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2907,12 +2907,17 @@ int sdhci_add_host(struct sdhci_host *host)
host->vqmmc = NULL;
}
} else {
- regulator_enable(host->vqmmc);
+ ret = regulator_enable(host->vqmmc);
if (!regulator_is_supported_voltage(host->vqmmc, 1700000,
1950000))
caps[1] &= ~(SDHCI_SUPPORT_SDR104 |
SDHCI_SUPPORT_SDR50 |
SDHCI_SUPPORT_DDR50);
+ if (ret) {
+ pr_warn("%s: Failed to enable vqmmc regulator: %d\n",
+ mmc_hostname(mmc), ret);
+ host->vqmmc = NULL;
+ }
}
if (host->quirks2 & SDHCI_QUIRK2_NO_1_8_V)
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
next prev parent reply other threads:[~2013-03-11 21:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-11 20:43 Regulator API ignored return values Arnd Bergmann
2013-03-11 20:43 ` Arnd Bergmann
2013-03-11 20:48 ` Stephen Warren
2013-03-11 20:48 ` Stephen Warren
2013-03-11 21:55 ` Chris Ball [this message]
2013-03-11 21:55 ` Chris Ball
2013-03-12 18:22 ` Mark Brown
2013-03-12 18:22 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2013-03-12 5:11 Jingoo Han
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=87a9q9iotg.fsf@octavius.laptop.org \
--to=cjb@laptop.org \
--cc=arnd@arndb.de \
--cc=axel.lin@ingics.com \
--cc=balbi@ti.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dtor@mail.ru \
--cc=jg1.han@samsung.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=swarren@wwwdotorg.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 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.