* [PATCH 1/2] mmc: dw_mmc: Check return value of regulator_enable
@ 2013-03-28 4:25 Sachin Kamat
2013-03-28 4:25 ` [PATCH 2/2] mmc: dw_mmc: Use pr_info instead of printk Sachin Kamat
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Sachin Kamat @ 2013-03-28 4:25 UTC (permalink / raw)
To: linux-mmc; +Cc: tgih.jun, jh80.chung, cjb, sachin.kamat, patches
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;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/2] mmc: dw_mmc: Use pr_info instead of printk
2013-03-28 4:25 [PATCH 1/2] mmc: dw_mmc: Check return value of regulator_enable Sachin Kamat
@ 2013-03-28 4:25 ` 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
2 siblings, 1 reply; 6+ messages in thread
From: Sachin Kamat @ 2013-03-28 4:25 UTC (permalink / raw)
To: linux-mmc; +Cc: tgih.jun, jh80.chung, cjb, sachin.kamat, patches
pr_info(... is preferred to printk(KERN_INFO ...
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
drivers/mmc/host/dw_mmc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 1ba09d0..b8582d0 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2509,7 +2509,7 @@ EXPORT_SYMBOL(dw_mci_resume);
static int __init dw_mci_init(void)
{
- printk(KERN_INFO "Synopsys Designware Multimedia Card Interface Driver");
+ pr_info("Synopsys Designware Multimedia Card Interface Driver");
return 0;
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 2/2] mmc: dw_mmc: Use pr_info instead of printk
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
0 siblings, 0 replies; 6+ messages in thread
From: Jaehoon Chung @ 2013-03-28 4:47 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-mmc, tgih.jun, jh80.chung, cjb, patches
Hi Sachin,
On 03/28/2013 01:25 PM, Sachin Kamat wrote:
> pr_info(... is preferred to printk(KERN_INFO ...
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> drivers/mmc/host/dw_mmc.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 1ba09d0..b8582d0 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -2509,7 +2509,7 @@ EXPORT_SYMBOL(dw_mci_resume);
>
> static int __init dw_mci_init(void)
> {
> - printk(KERN_INFO "Synopsys Designware Multimedia Card Interface Driver");
> + pr_info("Synopsys Designware Multimedia Card Interface Driver");
Using "...Card Interface Driver\n"?
Then this patch looks good to me.
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Best Regards,
Jaehoon Chung
> return 0;
> }
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] mmc: dw_mmc: Check return value of regulator_enable
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:42 ` Jaehoon Chung
2013-04-04 5:49 ` Seungwon Jeon
2 siblings, 0 replies; 6+ messages in thread
From: Jaehoon Chung @ 2013-03-28 4:42 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-mmc, tgih.jun, jh80.chung, cjb, patches
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;
>
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: [PATCH 1/2] mmc: dw_mmc: Check return value of regulator_enable
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:42 ` [PATCH 1/2] mmc: dw_mmc: Check return value of regulator_enable Jaehoon Chung
@ 2013-04-04 5:49 ` Seungwon Jeon
2013-04-04 5:56 ` Sachin Kamat
2 siblings, 1 reply; 6+ messages in thread
From: Seungwon Jeon @ 2013-04-04 5:49 UTC (permalink / raw)
To: 'Sachin Kamat', linux-mmc; +Cc: jh80.chung, cjb, patches
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
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 1/2] mmc: dw_mmc: Check return value of regulator_enable
2013-04-04 5:49 ` Seungwon Jeon
@ 2013-04-04 5:56 ` Sachin Kamat
0 siblings, 0 replies; 6+ messages in thread
From: Sachin Kamat @ 2013-04-04 5:56 UTC (permalink / raw)
To: Seungwon Jeon; +Cc: linux-mmc, jh80.chung, cjb, patches
On 4 April 2013 11:19, Seungwon Jeon <tgih.jun@samsung.com> wrote:
> 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?
Ok. I will resend with this change.
>
>> + 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
>
--
With warm regards,
Sachin
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-04-04 5:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-04-04 5:56 ` Sachin Kamat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox