diff mbox series

[U-Boot,2/8] mmc: do not overwrite cfg->f_max if "max-frequency" if missing

Message ID 1514566812-16781-3-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit c42ee367fdab51eb9add12e73e8a25306030bd44
Delegated to: Jaehoon Chung
Headers show
Series mmc: some fixes for core and add HS200 support for sdhci-cadence | expand

Commit Message

Masahiro Yamada Dec. 29, 2017, 5 p.m. UTC
mmc_of_parse() in U-Boot is a pussy helper; it sets cfg->f_max to
52MHz even if DT does not provide "max-frequency" at all.  This can
overwrite cfg->f_max that may have been set to a reasonable default.

As the DT binding says, "max-frequency" is an optional property.
Do nothing if DT does not specify it.  This is the behavior of
mmc_of_parse() in Linux.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mmc/mmc-uclass.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 793196b..37ce922 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -146,7 +146,8 @@  int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg)
 		break;
 	}
 
-	cfg->f_max = dev_read_u32_default(dev, "max-frequency", 52000000);
+	/* f_max is obtained from the optional "max-frequency" property */
+	dev_read_u32(dev, "max-frequency", &cfg->f_max);
 
 	if (dev_read_bool(dev, "cap-sd-highspeed"))
 		cfg->host_caps |= MMC_CAP(SD_HS);