mirror of
https://github.com/u-boot/u-boot.git
synced 2024-12-13 23:03:27 +08:00
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>
This commit is contained in:
parent
d0773524e1
commit
ff3882ac23
@ -582,30 +582,6 @@ static int mmc_set_capacity(struct mmc *mmc, int part_num)
|
|||||||
return 0;
|
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)
|
int mmc_switch_part(int dev_num, unsigned int part_num)
|
||||||
{
|
{
|
||||||
struct mmc *mmc = find_mmc_device(dev_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;
|
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,
|
int mmc_hwpart_config(struct mmc *mmc,
|
||||||
const struct mmc_hwpart_conf *conf,
|
const struct mmc_hwpart_conf *conf,
|
||||||
enum mmc_hwpart_conf_mode mode)
|
enum mmc_hwpart_conf_mode mode)
|
||||||
|
Loading…
Reference in New Issue
Block a user