summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPatrick Delaunay <[email protected]>2022-05-20 18:24:51 +0200
committerPatrick Delaunay <[email protected]>2022-06-17 10:41:16 +0200
commit79bdcd882e6d49e81d1c4a2a09d1142431508661 (patch)
tree569c810e16b278130056b45fadb3086f42cee48e /drivers
parenta46dce2817f574ee1186cc82a19ca9a99869b349 (diff)
mmc: stm32_sdmmc2: make reset property optional
Although not recommended, the reset property could be made optional. This way the driver will probe even if no reset property is provided in an sdmmc node in DT. This reset is already optional in Linux. Signed-off-by: Yann Gautier <[email protected]> Reviewed-by: Jaehoon Chung <[email protected]> Reviewed-by: Patrice Chotard <[email protected]> Signed-off-by: Patrick Delaunay <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/stm32_sdmmc2.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/mmc/stm32_sdmmc2.c b/drivers/mmc/stm32_sdmmc2.c
index 44bfc911af2..81b07609a91 100644
--- a/drivers/mmc/stm32_sdmmc2.c
+++ b/drivers/mmc/stm32_sdmmc2.c
@@ -514,10 +514,12 @@ retry_cmd:
*/
static void stm32_sdmmc2_reset(struct stm32_sdmmc2_priv *priv)
{
- /* Reset */
- reset_assert(&priv->reset_ctl);
- udelay(2);
- reset_deassert(&priv->reset_ctl);
+ if (reset_valid(&priv->reset_ctl)) {
+ /* Reset */
+ reset_assert(&priv->reset_ctl);
+ udelay(2);
+ reset_deassert(&priv->reset_ctl);
+ }
/* init the needed SDMMC register after reset */
writel(priv->pwr_reg_msk, priv->base + SDMMC_POWER);
@@ -735,7 +737,7 @@ static int stm32_sdmmc2_probe(struct udevice *dev)
ret = reset_get_by_index(dev, 0, &priv->reset_ctl);
if (ret)
- goto clk_disable;
+ dev_dbg(dev, "No reset provided\n");
gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio,
GPIOD_IS_IN);
@@ -755,8 +757,6 @@ static int stm32_sdmmc2_probe(struct udevice *dev)
stm32_sdmmc2_reset(priv);
return 0;
-clk_disable:
- clk_disable(&priv->clk);
clk_free:
clk_free(&priv->clk);