]> git.sur5r.net Git - u-boot/blobdiff - drivers/mmc/sh_sdhi.c
tools: kwbimage: Factor out add_binary_header_v1
[u-boot] / drivers / mmc / sh_sdhi.c
index e9d99a2bf832a081d3acd7a296c4724393da1363..25224e2e1db4b9fb4e4ceb2a276b5ac9035ea6c0 100644 (file)
@@ -13,7 +13,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <mmc.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/arch/rmobile.h>
 #include <asm/arch/sh_sdhi.h>
@@ -232,7 +232,7 @@ static int sh_sdhi_error_manage(struct sh_sdhi_host *host)
        e_state2 = sh_sdhi_readw(host, SDHI_ERR_STS2);
        if (e_state2 & ERR_STS2_SYS_ERROR) {
                if (e_state2 & ERR_STS2_RES_STOP_TIMEOUT)
-                       ret = TIMEOUT;
+                       ret = -ETIMEDOUT;
                else
                        ret = -EILSEQ;
                debug("%s: ERR_STS2 = %04x\n",
@@ -246,7 +246,7 @@ static int sh_sdhi_error_manage(struct sh_sdhi_host *host)
        if (e_state1 & ERR_STS1_CRC_ERROR || e_state1 & ERR_STS1_CMD_ERROR)
                ret = -EILSEQ;
        else
-               ret = TIMEOUT;
+               ret = -ETIMEDOUT;
 
        debug("%s: ERR_STS1 = %04x\n",
              DRIVER_NAME, sh_sdhi_readw(host, SDHI_ERR_STS1));
@@ -567,7 +567,7 @@ static int sh_sdhi_start_cmd(struct sh_sdhi_host *host,
                case MMC_CMD_SELECT_CARD:
                case SD_CMD_SEND_IF_COND:
                case MMC_CMD_APP_CMD:
-                       ret = TIMEOUT;
+                       ret = -ETIMEDOUT;
                        break;
                default:
                        debug(DRIVER_NAME": Cmd(d'%d) err\n", opc);
@@ -608,14 +608,14 @@ static int sh_sdhi_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
        return ret;
 }
 
-static void sh_sdhi_set_ios(struct mmc *mmc)
+static int sh_sdhi_set_ios(struct mmc *mmc)
 {
        int ret;
        struct sh_sdhi_host *host = mmc_priv(mmc);
 
        ret = sh_sdhi_clock_control(host, mmc->clock);
        if (ret)
-               return;
+               return -EINVAL;
 
        if (mmc->bus_width == 4)
                sh_sdhi_writew(host, SDHI_OPTION, ~OPT_BUS_WIDTH_1 &
@@ -625,6 +625,8 @@ static void sh_sdhi_set_ios(struct mmc *mmc)
                               sh_sdhi_readw(host, SDHI_OPTION));
 
        debug("clock = %d, buswidth = %d\n", mmc->clock, mmc->bus_width);
+
+       return 0;
 }
 
 static int sh_sdhi_initialize(struct mmc *mmc)