In cases when MMC hadn't been initialized before, ie. by the user or other
subsystem, it was still uninitialized while UMS media capacity check,
leading to broken ums command.
UMS has to initialize resources it uses.
Tested on Samsung Goni.
Signed-off-by: Mateusz Zalega <m.zalega@samsung.com>
Tested-by: Mateusz Zalega <m.zalega@samsung.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
struct ums *ums_init(unsigned int dev_num)
{
- struct mmc *mmc = NULL;
+ struct mmc *mmc = find_mmc_device(dev_num);
- mmc = find_mmc_device(dev_num);
- if (!mmc)
+ if (!mmc || mmc_init(mmc))
return NULL;
-
return ums_disk_init(mmc);
}