]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
mmc: change the set_ios return type from void to int
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 30 Dec 2016 06:30:16 +0000 (15:30 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 11 Jan 2017 10:40:13 +0000 (19:40 +0900)
To maintain consistency, set_ios type of legacy mmc_ops changed to int.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
20 files changed:
drivers/mmc/arm_pl180_mmci.c
drivers/mmc/bfin_sdh.c
drivers/mmc/davinci_mmc.c
drivers/mmc/dw_mmc.c
drivers/mmc/fsl_esdhc.c
drivers/mmc/ftsdc010_mci.c
drivers/mmc/gen_atmel_mci.c
drivers/mmc/mmc_spi.c
drivers/mmc/mvebu_mmc.c
drivers/mmc/mxcmmc.c
drivers/mmc/mxsmmc.c
drivers/mmc/omap_hsmmc.c
drivers/mmc/pxa_mmc_gen.c
drivers/mmc/s3c_sdi.c
drivers/mmc/sdhci.c
drivers/mmc/sh_mmcif.c
drivers/mmc/sh_sdhi.c
drivers/mmc/sunxi_mmc.c
drivers/mmc/tegra_mmc.c
include/mmc.h

index e64ac3c9939728ca38ef60a4c1e66066b87ad3fd..ddf8383f1c63163781205dd342108ac2af65a7ee 100644 (file)
@@ -275,7 +275,7 @@ static int mmc_host_reset(struct mmc *dev)
        return 0;
 }
 
-static void host_set_ios(struct mmc *dev)
+static int  host_set_ios(struct mmc *dev)
 {
        struct pl180_mmc_host *host = dev->priv;
        u32 sdi_clkcr;
@@ -333,6 +333,8 @@ static void host_set_ios(struct mmc *dev)
 
        writel(sdi_clkcr, &host->base->clock);
        udelay(CLK_CHANGE_DELAY);
+
+       return 0;
 }
 
 static const struct mmc_ops arm_pl180_mmci_ops = {
index 993a00cdb1aeb515383b59272952434000ed9cf4..1627dca3a1d00a4fb147dc673c2c830348963920 100644 (file)
@@ -234,7 +234,7 @@ static void sdh_set_clk(unsigned long clk)
                bfin_write_SDH_CLK_CTL(clk_ctl & ~CLK_E);
 }
 
-static void bfin_sdh_set_ios(struct mmc *mmc)
+static int bfin_sdh_set_ios(struct mmc *mmc)
 {
        u16 cfg = 0;
        u16 clk_ctl = 0;
@@ -250,6 +250,8 @@ static void bfin_sdh_set_ios(struct mmc *mmc)
        }
        bfin_write_SDH_CLK_CTL(clk_ctl);
        sdh_set_clk(mmc->clock);
+
+       return 0;
 }
 
 static int bfin_sdh_init(struct mmc *mmc)
index b495c7564cb2f000c33c2c343b362b887a37782e..9edb668e1499841dd96a425498cec8d7542cdfd0 100644 (file)
@@ -348,7 +348,7 @@ static int dmmc_init(struct mmc *mmc)
 }
 
 /* Set buswidth or clock as indicated by the GENERIC_MMC framework */
-static void dmmc_set_ios(struct mmc *mmc)
+static int dmmc_set_ios(struct mmc *mmc)
 {
        struct davinci_mmc *host = mmc->priv;
        struct davinci_mmc_regs *regs = host->reg_base;
@@ -362,6 +362,8 @@ static void dmmc_set_ios(struct mmc *mmc)
        /* Set clock speed */
        if (mmc->clock)
                dmmc_set_clock(mmc, mmc->clock);
+
+       return 0;
 }
 
 static const struct mmc_ops dmmc_ops = {
index d6ac46c1e04d93e308c0182191624de9338f1709..700f7644329bc7e72019c315ce5699a799f17edd 100644 (file)
@@ -388,7 +388,7 @@ static int dwmci_set_ios(struct udevice *dev)
 {
        struct mmc *mmc = mmc_get_mmc_dev(dev);
 #else
-static void dwmci_set_ios(struct mmc *mmc)
+static int dwmci_set_ios(struct mmc *mmc)
 {
 #endif
        struct dwmci_host *host = (struct dwmci_host *)mmc->priv;
@@ -421,9 +421,8 @@ static void dwmci_set_ios(struct mmc *mmc)
 
        if (host->clksel)
                host->clksel(host);
-#ifdef CONFIG_DM_MMC_OPS
+
        return 0;
-#endif
 }
 
 static int dwmci_init(struct mmc *mmc)
index 9796d39c65bd00a2cd21b4495815d3c45f20a5e7..7defeb4f2a7a649d918f69cbd8abc9f66cf97804 100644 (file)
@@ -592,7 +592,7 @@ static void esdhc_clock_control(struct mmc *mmc, bool enable)
 }
 #endif
 
-static void esdhc_set_ios(struct mmc *mmc)
+static int esdhc_set_ios(struct mmc *mmc)
 {
        struct fsl_esdhc_priv *priv = mmc->priv;
        struct fsl_esdhc *regs = priv->esdhc_regs;
@@ -614,6 +614,7 @@ static void esdhc_set_ios(struct mmc *mmc)
        else if (mmc->bus_width == 8)
                esdhc_setbits32(&regs->proctl, PROCTL_DTW_8);
 
+       return 0;
 }
 
 static int esdhc_init(struct mmc *mmc)
index e88c6322e9e88cb675b84b4423ce2b52b7b7bd44..652a718467aed589783c0091fa0f8850d1e40da9 100644 (file)
@@ -251,7 +251,7 @@ static int ftsdc010_request(struct mmc *mmc, struct mmc_cmd *cmd,
        return ret;
 }
 
-static void ftsdc010_set_ios(struct mmc *mmc)
+static int ftsdc010_set_ios(struct mmc *mmc)
 {
        struct ftsdc010_chip *chip = mmc->priv;
        struct ftsdc010_mmc __iomem *regs = chip->regs;
@@ -270,6 +270,8 @@ static void ftsdc010_set_ios(struct mmc *mmc)
                setbits_le32(&regs->bwr, FTSDC010_BWR_MODE_1BIT);
                break;
        }
+
+       return 0;
 }
 
 static int ftsdc010_init(struct mmc *mmc)
index cca0b04a6028b82d175b84ebc879dfd3f4a12c7d..7dc4a5de74e88c4f7dd796b6ad95009525a411cb 100644 (file)
@@ -336,7 +336,7 @@ mci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
 }
 
 /* Entered into mmc structure during driver init */
-static void mci_set_ios(struct mmc *mmc)
+static int mci_set_ios(struct mmc *mmc)
 {
        struct atmel_mci_priv *priv = mmc->priv;
        atmel_mci_t *mci = priv->mci;
@@ -370,6 +370,8 @@ static void mci_set_ios(struct mmc *mmc)
 
                writel(busw << 7 | MMCI_BF(SCDSEL, MCI_BUS), &mci->sdcr);
        }
+
+       return 0;
 }
 
 /* Entered into mmc structure during driver init */
index 25101179f65cb0e25632b526b74ad8f08cbbc46a..a9d95fbd7470fa8bbca2e87d511486c255311c65 100644 (file)
@@ -236,13 +236,14 @@ done:
        return ret;
 }
 
-static void mmc_spi_set_ios(struct mmc *mmc)
+static int mmc_spi_set_ios(struct mmc *mmc)
 {
        struct spi_slave *spi = mmc->priv;
 
        debug("%s: clock %u\n", __func__, mmc->clock);
        if (mmc->clock)
                spi_set_speed(spi, mmc->clock);
+       return 0;
 }
 
 static int mmc_spi_init_p(struct mmc *mmc)
index a2792ac4ecb76c4c7757ba4bc45e6b242a5b1619..3c7fb2130e041aef464b6b8ba090a54084b11446 100644 (file)
@@ -316,12 +316,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;
 }
 
 /*
index 5a385a37f8b85b304e6b1eb2b6d7ca96cf477321..dcf17c5d60e90a1569fd0dea00087375a0f665e4 100644 (file)
@@ -448,7 +448,7 @@ static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios)
        writel((prescaler << 4) | divider, &host->base->clk_rate);
 }
 
-static void mxcmci_set_ios(struct mmc *mmc)
+static int mxcmci_set_ios(struct mmc *mmc)
 {
        struct mxcmci_host *host = mmc->priv;
        if (mmc->bus_width == 4)
@@ -464,6 +464,8 @@ static void mxcmci_set_ios(struct mmc *mmc)
        }
 
        host->clock = mmc->clock;
+
+       return 0;
 }
 
 static int mxcmci_init(struct mmc *mmc)
index 089602840333758e8a6c058788ff8312ab3c7c28..fe1fe707a58b53faf797060d3de70b9c35cadd5c 100644 (file)
@@ -304,7 +304,7 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
        return 0;
 }
 
-static void mxsmmc_set_ios(struct mmc *mmc)
+static int mxsmmc_set_ios(struct mmc *mmc)
 {
        struct mxsmmc_priv *priv = mmc->priv;
        struct mxs_ssp_regs *ssp_regs = priv->regs;
@@ -331,6 +331,8 @@ static void mxsmmc_set_ios(struct mmc *mmc)
 
        debug("MMC%d: Set %d bits bus width\n",
                mmc->block_dev.devnum, mmc->bus_width);
+
+       return 0;
 }
 
 static int mxsmmc_init(struct mmc *mmc)
index 0a1ee407a1842c94bc2a87a41d04c1850919e0f7..b3268467dcc904e660bd5b09463704b6cbf247ea 100644 (file)
@@ -511,7 +511,7 @@ static int mmc_write_data(struct hsmmc *mmc_base, const char *buf,
        return 0;
 }
 
-static void omap_hsmmc_set_ios(struct mmc *mmc)
+static int omap_hsmmc_set_ios(struct mmc *mmc)
 {
        struct hsmmc *mmc_base;
        unsigned int dsor = 0;
@@ -559,10 +559,12 @@ static void omap_hsmmc_set_ios(struct mmc *mmc)
        while ((readl(&mmc_base->sysctl) & ICS_MASK) == ICS_NOTREADY) {
                if (get_timer(0) - start > MAX_RETRY_MS) {
                        printf("%s: timedout waiting for ics!\n", __func__);
-                       return;
+                       return -ETIMEDOUT;
                }
        }
        writel(readl(&mmc_base->sysctl) | CEN_ENABLE, &mmc_base->sysctl);
+
+       return 0;
 }
 
 #ifdef OMAP_HSMMC_USE_GPIO
index a5462e214817133cf4ac36b741b4b9d52a2c69f7..f627553cac5e1b0ce1540dcb123633f9f195815a 100644 (file)
@@ -313,7 +313,7 @@ static int pxa_mmc_request(struct mmc *mmc, struct mmc_cmd *cmd,
        return 0;
 }
 
-static void pxa_mmc_set_ios(struct mmc *mmc)
+static int pxa_mmc_set_ios(struct mmc *mmc)
 {
        struct pxa_mmc_priv *priv = mmc->priv;
        struct pxa_mmc_regs *regs = priv->regs;
@@ -322,13 +322,13 @@ static void pxa_mmc_set_ios(struct mmc *mmc)
 
        if (!mmc->clock) {
                pxa_mmc_stop_clock(mmc);
-               return;
+               return 0;
        }
 
        /* PXA3xx can do 26MHz with special settings. */
        if (mmc->clock == 26000000) {
                writel(0x7, &regs->clkrt);
-               return;
+               return 0;
        }
 
        /* Set clock to the card the usual way. */
@@ -342,6 +342,8 @@ static void pxa_mmc_set_ios(struct mmc *mmc)
        }
 
        writel(pxa_mmc_clock, &regs->clkrt);
+
+       return 0;
 }
 
 static int pxa_mmc_init(struct mmc *mmc)
index 1b8358a7bc1d87b5fee917710f95ad77d11bab72..faf7b83a14ce5c66cf1cf382b5a0cfef4c896db8 100644 (file)
@@ -207,7 +207,7 @@ error:
        return ret;
 }
 
-static void s3cmmc_set_ios(struct mmc *mmc)
+static int s3cmmc_set_ios(struct mmc *mmc)
 {
        struct s3c24x0_sdi *sdi_regs = s3c24x0_get_base_sdi();
        uint32_t divider = 0;
@@ -215,7 +215,7 @@ static void s3cmmc_set_ios(struct mmc *mmc)
        wide_bus = (mmc->bus_width == 4);
 
        if (!mmc->clock)
-               return;
+               return 0;
 
        divider = DIV_ROUND_UP(get_PCLK(), mmc->clock);
        if (divider)
@@ -223,6 +223,8 @@ static void s3cmmc_set_ios(struct mmc *mmc)
 
        writel(divider, &sdi_regs->sdipre);
        mdelay(125);
+
+       return 0;
 }
 
 static int s3cmmc_init(struct mmc *mmc)
index dadee15c8fd8b73febd0f8a8d6d215d91b984952..9125e5d1f897fd587723c23fa84dd3f464be784f 100644 (file)
@@ -424,7 +424,7 @@ static int sdhci_set_ios(struct udevice *dev)
 {
        struct mmc *mmc = mmc_get_mmc_dev(dev);
 #else
-static void sdhci_set_ios(struct mmc *mmc)
+static int sdhci_set_ios(struct mmc *mmc)
 {
 #endif
        u32 ctrl;
@@ -462,9 +462,8 @@ static void sdhci_set_ios(struct mmc *mmc)
                ctrl &= ~SDHCI_CTRL_HISPD;
 
        sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
-#ifdef CONFIG_DM_MMC_OPS
+
        return 0;
-#endif
 }
 
 static int sdhci_init(struct mmc *mmc)
index 69ded9ee2c8952c3e5b660b327d42f58bd4bd211..1ff59f06d576b77dbfe1fc92ba7f44f5a9d0e006 100644 (file)
@@ -539,7 +539,7 @@ static int sh_mmcif_request(struct mmc *mmc, struct mmc_cmd *cmd,
        return ret;
 }
 
-static void sh_mmcif_set_ios(struct mmc *mmc)
+static int sh_mmcif_set_ios(struct mmc *mmc)
 {
        struct sh_mmcif_host *host = mmc->priv;
 
@@ -554,6 +554,8 @@ static void sh_mmcif_set_ios(struct mmc *mmc)
                host->bus_width = MMC_BUS_WIDTH_1;
 
        debug("clock = %d, buswidth = %d\n", mmc->clock, mmc->bus_width);
+
+       return 0;
 }
 
 static int sh_mmcif_init(struct mmc *mmc)
index 78e2ef643c954a0f1bcf5ed839092c6280bc9a40..25224e2e1db4b9fb4e4ceb2a276b5ac9035ea6c0 100644 (file)
@@ -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)
index b8716c93cb06df7e04f3d3b3719c50cee65bf8f7..fd3fc2af40a05b1a418981b5c8e8d05017cde3d0 100644 (file)
@@ -227,7 +227,7 @@ static int mmc_config_clock(struct mmc *mmc)
        return 0;
 }
 
-static void sunxi_mmc_set_ios(struct mmc *mmc)
+static int sunxi_mmc_set_ios(struct mmc *mmc)
 {
        struct sunxi_mmc_host *mmchost = mmc->priv;
 
@@ -237,7 +237,7 @@ static void sunxi_mmc_set_ios(struct mmc *mmc)
        /* Change clock first */
        if (mmc->clock && mmc_config_clock(mmc) != 0) {
                mmchost->fatal_err = 1;
-               return;
+               return -EINVAL;
        }
 
        /* Change bus width */
@@ -247,6 +247,8 @@ static void sunxi_mmc_set_ios(struct mmc *mmc)
                writel(0x1, &mmchost->reg->width);
        else
                writel(0x0, &mmchost->reg->width);
+
+       return 0;
 }
 
 static int sunxi_mmc_core_init(struct mmc *mmc)
index 97b115459546ec8606895df4ef9da104f7d82366..0211dc7b80d7a3f6e53bfb0c407fff04d8e2b233 100644 (file)
@@ -408,7 +408,7 @@ out:
        priv->clock = clock;
 }
 
-static void tegra_mmc_set_ios(struct mmc *mmc)
+static int tegra_mmc_set_ios(struct mmc *mmc)
 {
        struct tegra_mmc_priv *priv = mmc->priv;
        unsigned char ctrl;
@@ -438,6 +438,8 @@ static void tegra_mmc_set_ios(struct mmc *mmc)
 
        writeb(ctrl, &priv->reg->hostctl);
        debug("mmc_set_ios: hostctl = %08X\n", ctrl);
+
+       return 0;
 }
 
 static void tegra_mmc_pad_init(struct tegra_mmc_priv *priv)
index 1720955a4c904e8e1a30e4685059cdf2013b671a..fad12d608cef8194f8e6443de9ad97026291989d 100644 (file)
@@ -376,7 +376,7 @@ int mmc_getwp(struct mmc *mmc);
 struct mmc_ops {
        int (*send_cmd)(struct mmc *mmc,
                        struct mmc_cmd *cmd, struct mmc_data *data);
-       void (*set_ios)(struct mmc *mmc);
+       int (*set_ios)(struct mmc *mmc);
        int (*init)(struct mmc *mmc);
        int (*getcd)(struct mmc *mmc);
        int (*getwp)(struct mmc *mmc);