From: Mateusz Zalega Date: Mon, 28 Apr 2014 19:13:26 +0000 (+0200) Subject: ums: always initialize mmc before ums_disk_init() X-Git-Tag: v2014.07-rc1~8^2~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=41c2d60b3abad79f94a872d53ede016b1a891abc;p=oweals%2Fu-boot.git ums: always initialize mmc before ums_disk_init() 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 Tested-by: Mateusz Zalega Acked-by: Lukasz Majewski Cc: Minkyu Kang --- diff --git a/board/samsung/common/ums.c b/board/samsung/common/ums.c index dc155ad0e5..cebabe920a 100644 --- a/board/samsung/common/ums.c +++ b/board/samsung/common/ums.c @@ -66,11 +66,9 @@ static struct ums *ums_disk_init(struct mmc *mmc) 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); }