cmd: mmc: find current device first before find mmc device
Find the current device before find mmc device, otherwise '-1' will be use as curr_device and error occur. The error log is "MMC Device -1 not found". Change-Id: Id6157f73d006f4bbe1c4d105244eb59ca7290c13 Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
This commit is contained in:
parent
278b570da4
commit
b75a3992f5
|
|
@ -188,6 +188,15 @@ int init_rpmb(void)
|
||||||
{
|
{
|
||||||
struct mmc *mmc;
|
struct mmc *mmc;
|
||||||
|
|
||||||
|
if (curr_device < 0) {
|
||||||
|
if (get_mmc_num() > 0) {
|
||||||
|
curr_device = 0;
|
||||||
|
} else {
|
||||||
|
printf("No MMC device available\n");
|
||||||
|
return CMD_RET_FAILURE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mmc = init_mmc_device(curr_device, false);
|
mmc = init_mmc_device(curr_device, false);
|
||||||
if (!mmc)
|
if (!mmc)
|
||||||
return CMD_RET_FAILURE;
|
return CMD_RET_FAILURE;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue