]> git.sur5r.net Git - u-boot/commitdiff
mmc: fix to assign to correct clock value when clock is enabling
authorJaehoon Chung <jh80.chung@samsung.com>
Tue, 23 Jan 2018 05:04:30 +0000 (14:04 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 24 Jan 2018 07:08:27 +0000 (16:08 +0900)
When clock is enabling, it's assigned to 0 as mmc->clock.
Then it can't initialize any card.
Fix to assign to correct clock value as mmc->cfg->f_min or f_max.

Fixes: 9546eb92cb6 ("mmc: fix the wrong disabling clock")
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Guillaume GARDET <guillaume.gardet@free.fr>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
drivers/mmc/mmc.c

index 311f51f237776aba735deef51237196da0359158..2d0e7bb3a27cdc3dace9381c7ab8bd1f34ff19f9 100644 (file)
@@ -1501,7 +1501,7 @@ static int mmc_set_ios(struct mmc *mmc)
 
 int mmc_set_clock(struct mmc *mmc, uint clock, bool disable)
 {
-       if (!disable && clock != 0) {
+       if (!disable) {
                if (clock > mmc->cfg->f_max)
                        clock = mmc->cfg->f_max;