From 70f862808e8ae4b97fe736ec9d9d496881ad84b2 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Tue, 19 Jul 2016 16:33:35 +0900 Subject: mmc: fsl_esdhc: remove the duplicated header file "mmc.h" is already included. It's duplicated. Signed-off-by: Jaehoon Chung Reviewed-by: Simon Glass --- drivers/mmc/fsl_esdhc.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/mmc/fsl_esdhc.c') diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index a865c7b47b..86c9a67a5e 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include -- cgit From 915ffa5213756568f6185d05cda2cb2f6050f974 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Tue, 19 Jul 2016 16:33:36 +0900 Subject: mmc: use the generic error number Use the generic error number instead of specific error number. If use the generic error number, it can debug more easier. Signed-off-by: Jaehoon Chung Reviewed-by: Simon Glass Reviewed-by: Minkyu Kang --- drivers/mmc/fsl_esdhc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'drivers/mmc/fsl_esdhc.c') diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 86c9a67a5e..103b32e9cf 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -252,7 +253,7 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data) if ((esdhc_read32(®s->prsstat) & PRSSTAT_WPSPL) == 0) { printf("\nThe SD card is locked. Can not write to a locked card.\n\n"); - return TIMEOUT; + return -ETIMEDOUT; } } @@ -410,12 +411,12 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) irqstat = esdhc_read32(®s->irqstat); if (irqstat & CMD_ERR) { - err = COMM_ERR; + err = -ECOMM; goto out; } if (irqstat & IRQSTAT_CTOE) { - err = TIMEOUT; + err = -ETIMEDOUT; goto out; } @@ -441,7 +442,7 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) if (timeout <= 0) { printf("Timeout waiting for DAT0 to go high!\n"); - err = TIMEOUT; + err = -ETIMEDOUT; goto out; } } @@ -470,12 +471,12 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) irqstat = esdhc_read32(®s->irqstat); if (irqstat & IRQSTAT_DTOE) { - err = TIMEOUT; + err = -ETIMEDOUT; goto out; } if (irqstat & DATA_ERR) { - err = COMM_ERR; + err = -ECOMM; goto out; } } while ((irqstat & DATA_COMPLETE) != DATA_COMPLETE); -- cgit