summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2020-05-19 11:06:43 +0800
committerPeng Fan <peng.fan@nxp.com>2020-06-15 09:45:22 +0800
commit9abf648436b49553e6cb4a7f03a021720616d75b (patch)
tree876a601cb5c04ae6da372e467a3afb7dd5b86f9c /drivers
parent9d886fd6a0888f121cd280d11434812a386045a2 (diff)
mmc: fsl_esdhc: read register once for card inserted status
No need to poll register for card inserted status. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Acked-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/fsl_esdhc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index d5d955846c..704407981b 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright 2007, 2010-2011 Freescale Semiconductor, Inc
- * Copyright 2019 NXP Semiconductors
+ * Copyright 2019-2020 NXP
* Andy Fleming
*
* Based vaguely on the pxa mmc code:
@@ -630,16 +630,15 @@ static int esdhc_init_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)
static int esdhc_getcd_common(struct fsl_esdhc_priv *priv)
{
struct fsl_esdhc *regs = priv->esdhc_regs;
- int timeout = 1000;
#ifdef CONFIG_ESDHC_DETECT_QUIRK
if (CONFIG_ESDHC_DETECT_QUIRK)
return 1;
#endif
- while (!(esdhc_read32(&regs->prsstat) & PRSSTAT_CINS) && --timeout)
- udelay(1000);
+ if (esdhc_read32(&regs->prsstat) & PRSSTAT_CINS)
+ return 1;
- return timeout > 0;
+ return 0;
}
static void fsl_esdhc_get_cfg_common(struct fsl_esdhc_priv *priv,