* [PATCH] mmc: display an error number to debug
[not found] <CGME20201106112245epcas1p215d189a18b3a5833468bb9650071926d@epcas1p2.samsung.com>
@ 2020-11-06 11:23 ` Jaehoon Chung
2020-11-09 2:11 ` Peng Fan
2020-11-16 15:39 ` Stephen Warren
0 siblings, 2 replies; 4+ messages in thread
From: Jaehoon Chung @ 2020-11-06 11:23 UTC (permalink / raw)
To: u-boot
It's useful to know an error number when it's debugging.
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
drivers/mmc/mmc.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 7783535d0953..2457c6fef97a 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -2179,7 +2179,7 @@ static int mmc_select_mode_and_width(struct mmc *mmc, uint card_caps)
err = mmc_execute_tuning(mmc,
mwt->tuning);
if (err) {
- pr_debug("tuning failed\n");
+ pr_debug("tuning failed : %d\n", err);
goto error;
}
}
@@ -2200,7 +2200,7 @@ error:
}
}
- pr_err("unable to select a mode\n");
+ pr_err("unable to select a mode : %d\n", err);
return -ENOTSUPP;
}
@@ -2746,7 +2746,7 @@ static int mmc_power_on(struct mmc *mmc)
int ret = regulator_set_enable(mmc->vmmc_supply, true);
if (ret) {
- puts("Error enabling VMMC supply\n");
+ puts("Error enabling VMMC supply : %d\n", ret);
return ret;
}
}
@@ -2762,7 +2762,7 @@ static int mmc_power_off(struct mmc *mmc)
int ret = regulator_set_enable(mmc->vmmc_supply, false);
if (ret) {
- pr_debug("Error disabling VMMC supply\n");
+ pr_debug("Error disabling VMMC supply : %d\n", ret);
return ret;
}
}
@@ -2866,7 +2866,7 @@ retry:
if (err) {
#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
- pr_err("Card did not respond to voltage select!\n");
+ pr_err("Card did not respond to voltage select! : %d\n", err);
#endif
return -EOPNOTSUPP;
}
--
2.29.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] mmc: display an error number to debug
2020-11-06 11:23 ` [PATCH] mmc: display an error number to debug Jaehoon Chung
@ 2020-11-09 2:11 ` Peng Fan
2020-11-16 15:39 ` Stephen Warren
1 sibling, 0 replies; 4+ messages in thread
From: Peng Fan @ 2020-11-09 2:11 UTC (permalink / raw)
To: u-boot
> Subject: [PATCH] mmc: display an error number to debug
>
> It's useful to know an error number when it's debugging.
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
> drivers/mmc/mmc.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index
> 7783535d0953..2457c6fef97a 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -2179,7 +2179,7 @@ static int mmc_select_mode_and_width(struct
> mmc *mmc, uint card_caps)
> err = mmc_execute_tuning(mmc,
> mwt->tuning);
> if (err) {
> - pr_debug("tuning failed\n");
> + pr_debug("tuning failed : %d\n", err);
> goto error;
> }
> }
> @@ -2200,7 +2200,7 @@ error:
> }
> }
>
> - pr_err("unable to select a mode\n");
> + pr_err("unable to select a mode : %d\n", err);
>
> return -ENOTSUPP;
> }
> @@ -2746,7 +2746,7 @@ static int mmc_power_on(struct mmc *mmc)
> int ret = regulator_set_enable(mmc->vmmc_supply, true);
>
> if (ret) {
> - puts("Error enabling VMMC supply\n");
> + puts("Error enabling VMMC supply : %d\n", ret);
> return ret;
> }
> }
> @@ -2762,7 +2762,7 @@ static int mmc_power_off(struct mmc *mmc)
> int ret = regulator_set_enable(mmc->vmmc_supply, false);
>
> if (ret) {
> - pr_debug("Error disabling VMMC supply\n");
> + pr_debug("Error disabling VMMC supply : %d\n", ret);
> return ret;
> }
> }
> @@ -2866,7 +2866,7 @@ retry:
>
> if (err) {
> #if !defined(CONFIG_SPL_BUILD) ||
> defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
> - pr_err("Card did not respond to voltage select!\n");
> + pr_err("Card did not respond to voltage select! : %d\n", err);
> #endif
> return -EOPNOTSUPP;
> }
> --
Reviewed-by: Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] mmc: display an error number to debug
2020-11-06 11:23 ` [PATCH] mmc: display an error number to debug Jaehoon Chung
2020-11-09 2:11 ` Peng Fan
@ 2020-11-16 15:39 ` Stephen Warren
2020-11-16 21:38 ` Jaehoon Chung
1 sibling, 1 reply; 4+ messages in thread
From: Stephen Warren @ 2020-11-16 15:39 UTC (permalink / raw)
To: u-boot
On 11/6/20 4:23 AM, Jaehoon Chung wrote:
> It's useful to know an error number when it's debugging.
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> @@ -2746,7 +2746,7 @@ static int mmc_power_on(struct mmc *mmc)
> int ret = regulator_set_enable(mmc->vmmc_supply, true);
>
> if (ret) {
> - puts("Error enabling VMMC supply\n");
> + puts("Error enabling VMMC supply : %d\n", ret);
At least this one needs to be printf() not puts(). This causes build
failures for any board that compiles this code, i.e. anything with the
following enabled:
static int mmc_power_on(struct mmc *mmc)
{
#if CONFIG_IS_ENABLED(DM_MMC) && CONFIG_IS_ENABLED(DM_REGULATOR)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] mmc: display an error number to debug
2020-11-16 15:39 ` Stephen Warren
@ 2020-11-16 21:38 ` Jaehoon Chung
0 siblings, 0 replies; 4+ messages in thread
From: Jaehoon Chung @ 2020-11-16 21:38 UTC (permalink / raw)
To: u-boot
Dear Stephen,
On 11/17/20 12:39 AM, Stephen Warren wrote:
> On 11/6/20 4:23 AM, Jaehoon Chung wrote:
>> It's useful to know an error number when it's debugging.
>
>> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
>
>> @@ -2746,7 +2746,7 @@ static int mmc_power_on(struct mmc *mmc)
>> int ret = regulator_set_enable(mmc->vmmc_supply, true);
>>
>> if (ret) {
>> - puts("Error enabling VMMC supply\n");
>> + puts("Error enabling VMMC supply : %d\n", ret);
>
> At least this one needs to be printf() not puts(). This causes build
> failures for any board that compiles this code, i.e. anything with the
> following enabled:
Thanks for pointing out! Will fix.
Best Regards,
Jaehoon Chung
>
> static int mmc_power_on(struct mmc *mmc)
> {
> #if CONFIG_IS_ENABLED(DM_MMC) && CONFIG_IS_ENABLED(DM_REGULATOR)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-11-16 21:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20201106112245epcas1p215d189a18b3a5833468bb9650071926d@epcas1p2.samsung.com>
2020-11-06 11:23 ` [PATCH] mmc: display an error number to debug Jaehoon Chung
2020-11-09 2:11 ` Peng Fan
2020-11-16 15:39 ` Stephen Warren
2020-11-16 21:38 ` Jaehoon Chung
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.