]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
mmc: make mmc_set_ios() return status
authorKishon Vijay Abraham I <kishon@ti.com>
Thu, 21 Sep 2017 14:29:59 +0000 (16:29 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 12 Jan 2018 09:11:04 +0000 (18:11 +0900)
set_ios callback has a return value of 'int' but the mmc_set_ios()
function ignore this. Modify mmc_set_ios() and the callers of mmc_set_ios() to
to return the error status.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/mmc/mmc.c
include/mmc.h

index 822b66b906c4b5781b4fc0d0cdd12801bbcfe167..588cfb2b2e3147cc16ce877ec8db20f6eedf9096 100644 (file)
@@ -1196,14 +1196,18 @@ static inline int bus_width(uint cap)
 }
 
 #if !CONFIG_IS_ENABLED(DM_MMC)
-static void mmc_set_ios(struct mmc *mmc)
+static int mmc_set_ios(struct mmc *mmc)
 {
+       int ret = 0;
+
        if (mmc->cfg->ops->set_ios)
-               mmc->cfg->ops->set_ios(mmc);
+               ret = mmc->cfg->ops->set_ios(mmc);
+
+       return ret;
 }
 #endif
 
-void mmc_set_clock(struct mmc *mmc, uint clock)
+int mmc_set_clock(struct mmc *mmc, uint clock)
 {
        if (clock > mmc->cfg->f_max)
                clock = mmc->cfg->f_max;
@@ -1213,14 +1217,14 @@ void mmc_set_clock(struct mmc *mmc, uint clock)
 
        mmc->clock = clock;
 
-       mmc_set_ios(mmc);
+       return mmc_set_ios(mmc);
 }
 
-static void mmc_set_bus_width(struct mmc *mmc, uint width)
+static int mmc_set_bus_width(struct mmc *mmc, uint width)
 {
        mmc->bus_width = width;
 
-       mmc_set_ios(mmc);
+       return mmc_set_ios(mmc);
 }
 
 #if CONFIG_IS_ENABLED(MMC_VERBOSE) || defined(DEBUG)
index 988bf177d7bdda63bdd711e37350e94d91f45687..3e57887af0196f1c41e92181a1c9ed40ef718c48 100644 (file)
@@ -549,7 +549,7 @@ int mmc_unbind(struct udevice *dev);
 int mmc_initialize(bd_t *bis);
 int mmc_init(struct mmc *mmc);
 int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size);
-void mmc_set_clock(struct mmc *mmc, uint clock);
+int mmc_set_clock(struct mmc *mmc, uint clock);
 struct mmc *find_mmc_device(int dev_num);
 int mmc_set_dev(int dev_num);
 void print_mmc_devices(char separator);