summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-05-01 13:52:25 -0600
committerSimon Glass <sjg@chromium.org>2016-05-17 09:54:43 -0600
commitff3882ac23fcfda81284f372924063036bea507b (patch)
treeabddc2cd94d9bc6edb86c7f2345edee33542fcca /drivers
parentd0773524e18d2439390c88611b49f23ca46a82be (diff)
downloadu-boot-imx-ff3882ac23fcfda81284f372924063036bea507b.zip
u-boot-imx-ff3882ac23fcfda81284f372924063036bea507b.tar.gz
u-boot-imx-ff3882ac23fcfda81284f372924063036bea507b.tar.bz2
dm: mmc: Move mmc_switch_part() above its callers
This function is defined after it is used. In preparation for making it static, move it up a little. Also drop the printf() which should not appear in a driver. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/mmc.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 185d7b2..2211ac6 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -582,30 +582,6 @@ static int mmc_set_capacity(struct mmc *mmc, int part_num)
return 0;
}
-int mmc_select_hwpart(int dev_num, int hwpart)
-{
- struct mmc *mmc = find_mmc_device(dev_num);
- int ret;
-
- if (!mmc)
- return -ENODEV;
-
- if (mmc->block_dev.hwpart == hwpart)
- return 0;
-
- if (mmc->part_config == MMCPART_NOAVAILABLE) {
- printf("Card doesn't support part_switch\n");
- return -EMEDIUMTYPE;
- }
-
- ret = mmc_switch_part(dev_num, hwpart);
- if (ret)
- return ret;
-
- return 0;
-}
-
-
int mmc_switch_part(int dev_num, unsigned int part_num)
{
struct mmc *mmc = find_mmc_device(dev_num);
@@ -630,6 +606,27 @@ int mmc_switch_part(int dev_num, unsigned int part_num)
return ret;
}
+int mmc_select_hwpart(int dev_num, int hwpart)
+{
+ struct mmc *mmc = find_mmc_device(dev_num);
+ int ret;
+
+ if (!mmc)
+ return -ENODEV;
+
+ if (mmc->block_dev.hwpart == hwpart)
+ return 0;
+
+ if (mmc->part_config == MMCPART_NOAVAILABLE)
+ return -EMEDIUMTYPE;
+
+ ret = mmc_switch_part(dev_num, hwpart);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
int mmc_hwpart_config(struct mmc *mmc,
const struct mmc_hwpart_conf *conf,
enum mmc_hwpart_conf_mode mode)