diff options
author | Yangbo Lu <yangbo.lu@nxp.com> | 2019-10-31 18:54:24 +0800 |
---|---|---|
committer | Peng Fan <peng.fan@nxp.com> | 2019-11-05 11:21:25 +0800 |
commit | 08197cb8dff7cd097ab07a325093043c39d19bbd (patch) | |
tree | f514334f062cdad4620ed862ba7b7bb318541a25 /drivers/mmc | |
parent | 5705973b093e226d3122d1d6439628e1dad24528 (diff) | |
download | u-boot-08197cb8dff7cd097ab07a325093043c39d19bbd.tar.gz |
mmc: fsl_esdhc: drop redundant code for non-removable feature
Drop redundant code for non-removable feature. "non-removable" property
has been read in mmc_of_parse().
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/fsl_esdhc.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 2b7bcab6fc..25a8fe3480 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -75,7 +75,6 @@ struct fsl_esdhc_plat { * @mmc: mmc * Following is used when Driver Model is enabled for MMC * @dev: pointer for the device - * @non_removable: 0: removable; 1: non-removable * @wp_enable: 1: enable checking wp; 0: no check * @cd_gpio: gpio for card detection * @wp_gpio: gpio for write protection @@ -89,7 +88,6 @@ struct fsl_esdhc_priv { struct mmc *mmc; #endif struct udevice *dev; - int non_removable; int wp_enable; }; @@ -628,12 +626,6 @@ static int esdhc_getcd_common(struct fsl_esdhc_priv *priv) if (CONFIG_ESDHC_DETECT_QUIRK) return 1; #endif - -#if CONFIG_IS_ENABLED(DM_MMC) - if (priv->non_removable) - return 1; -#endif - while (!(esdhc_read32(®s->prsstat) & PRSSTAT_CINS) && --timeout) udelay(1000); @@ -870,12 +862,6 @@ static int fsl_esdhc_probe(struct udevice *dev) #endif priv->dev = dev; - if (dev_read_bool(dev, "non-removable")) { - priv->non_removable = 1; - } else { - priv->non_removable = 0; - } - priv->wp_enable = 1; if (IS_ENABLED(CONFIG_CLK)) { @@ -919,8 +905,12 @@ static int fsl_esdhc_probe(struct udevice *dev) static int fsl_esdhc_get_cd(struct udevice *dev) { + struct fsl_esdhc_plat *plat = dev_get_platdata(dev); struct fsl_esdhc_priv *priv = dev_get_priv(dev); + if (plat->cfg.host_caps & MMC_CAP_NONREMOVABLE) + return 1; + return esdhc_getcd_common(priv); } |