Commit 41c2d60b3abad79f94a872d53ede016b1a891abc
Committed by
Lukasz Majewski
1 parent
b7d4259af2
Exists in
v2017.01-smarct4x
and in
40 other branches
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 <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>
Showing 1 changed file with 2 additions and 4 deletions Side-by-side Diff
board/samsung/common/ums.c
... | ... | @@ -66,12 +66,10 @@ |
66 | 66 | |
67 | 67 | struct ums *ums_init(unsigned int dev_num) |
68 | 68 | { |
69 | - struct mmc *mmc = NULL; | |
69 | + struct mmc *mmc = find_mmc_device(dev_num); | |
70 | 70 | |
71 | - mmc = find_mmc_device(dev_num); | |
72 | - if (!mmc) | |
71 | + if (!mmc || mmc_init(mmc)) | |
73 | 72 | return NULL; |
74 | - | |
75 | 73 | return ums_disk_init(mmc); |
76 | 74 | } |