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/davinci_mmc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/mmc/davinci_mmc.c') diff --git a/drivers/mmc/davinci_mmc.c b/drivers/mmc/davinci_mmc.c index aae00e9dab..b495c7564c 100644 --- a/drivers/mmc/davinci_mmc.c +++ b/drivers/mmc/davinci_mmc.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -66,7 +67,7 @@ dmmc_wait_fifo_status(volatile struct davinci_mmc_regs *regs, uint status) udelay(100); if (wdog == 0) - return COMM_ERR; + return -ECOMM; return 0; } @@ -80,7 +81,7 @@ static int dmmc_busy_wait(volatile struct davinci_mmc_regs *regs) udelay(10); if (wdog == 0) - return COMM_ERR; + return -ECOMM; return 0; } @@ -99,7 +100,7 @@ static int dmmc_check_status(volatile struct davinci_mmc_regs *regs, return 0; } else if (mmcstatus & st_error) { if (mmcstatus & MMCST0_TOUTRS) - return TIMEOUT; + return -ETIMEDOUT; printf("[ ST0 ERROR %x]\n", mmcstatus); /* * Ignore CRC errors as some MMC cards fail to @@ -107,7 +108,7 @@ static int dmmc_check_status(volatile struct davinci_mmc_regs *regs, */ if (mmcstatus & MMCST0_CRCRS) return 0; - return COMM_ERR; + return -ECOMM; } udelay(10); @@ -116,7 +117,7 @@ static int dmmc_check_status(volatile struct davinci_mmc_regs *regs, printf("Status %x Timeout ST0:%x ST1:%x\n", st_ready, mmcstatus, get_val(®s->mmcst1)); - return COMM_ERR; + return -ECOMM; } /* -- cgit