]> git.sur5r.net Git - u-boot/blobdiff - drivers/mmc/mvebu_mmc.c
mtd: nand: mxs_nand: use self init
[u-boot] / drivers / mmc / mvebu_mmc.c
index 056aef5bef07c54e8ac8759dcaf17869a0ebc7ad..958ac17954b2b7bcfd37e4bb407fc289c69a2046 100644 (file)
@@ -1,14 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Marvell MMC/SD/SDIO driver
  *
  * (C) Copyright 2012-2014
  * Marvell Semiconductor <www.marvell.com>
  * Written-by: Maen Suleiman, Gerald Kerma
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <errno.h>
 #include <malloc.h>
 #include <part.h>
 #include <mmc.h>
@@ -172,15 +172,15 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
                            (SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT)) {
                                debug("%s: command READ timed out\n",
                                      DRIVER_NAME);
-                               return TIMEOUT;
+                               return -ETIMEDOUT;
                        }
                        debug("%s: command READ error\n", DRIVER_NAME);
-                       return COMM_ERR;
+                       return -ECOMM;
                }
 
                if ((get_timer(0) - start) > TIMEOUT_DELAY) {
                        debug("%s: command timed out\n", DRIVER_NAME);
-                       return TIMEOUT;
+                       return -ETIMEDOUT;
                }
        }
 
@@ -232,7 +232,7 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
 
        if (mvebu_mmc_read(SDIO_ERR_INTR_STATUS) &
                (SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT))
-               return TIMEOUT;
+               return -ETIMEDOUT;
 
        return 0;
 }
@@ -315,12 +315,14 @@ static void mvebu_mmc_set_bus(unsigned int bus)
        mvebu_mmc_write(SDIO_HOST_CTRL, ctrl_reg);
 }
 
-static void mvebu_mmc_set_ios(struct mmc *mmc)
+static int mvebu_mmc_set_ios(struct mmc *mmc)
 {
        debug("%s: bus[%d] clock[%d]\n", DRIVER_NAME,
              mmc->bus_width, mmc->clock);
        mvebu_mmc_set_bus(mmc->bus_width);
        mvebu_mmc_set_clk(mmc->clock);
+
+       return 0;
 }
 
 /*