]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
mmc: sdhci: Return error in case of failure
authorT Karthik Reddy <t.karthik.reddy@xilinx.com>
Thu, 29 Apr 2021 14:02:26 +0000 (08:02 -0600)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 1 Jun 2021 11:38:24 +0000 (13:38 +0200)
set_delay() function is from sdhci host ops, which does not return
any error case due to void return type. Where
arasan_sdhci_set_tapdelay() from arasan sdhci driver returns error
when there is a failure. So set return type to set_delay().

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
drivers/mmc/sdhci.c
drivers/mmc/zynq_sdhci.c
include/sdhci.h

index f25a9390232d1464125d1868645534576fd0751d..7ade95bba372f73435f7fa049afe7b2d6cc33164 100644 (file)
@@ -361,6 +361,7 @@ int sdhci_set_clock(struct mmc *mmc, unsigned int clock)
 {
        struct sdhci_host *host = mmc->priv;
        unsigned int div, clk = 0, timeout;
+       int ret;
 
        /* Wait max 20 ms */
        timeout = 200;
@@ -381,8 +382,11 @@ int sdhci_set_clock(struct mmc *mmc, unsigned int clock)
        if (clock == 0)
                return 0;
 
-       if (host->ops && host->ops->set_delay)
-               host->ops->set_delay(host);
+       if (host->ops && host->ops->set_delay) {
+               ret = host->ops->set_delay(host);
+               if (ret)
+                       return ret;
+       }
 
        if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
                /*
index d104337850ce0441cac6c27e7692059ba6919ad2..1f6a5d526de702994348c6973a5a45166c007ade 100644 (file)
@@ -422,7 +422,7 @@ static int sdhci_versal_sampleclk_set_phase(struct sdhci_host *host,
        return 0;
 }
 
-static void arasan_sdhci_set_tapdelay(struct sdhci_host *host)
+static int arasan_sdhci_set_tapdelay(struct sdhci_host *host)
 {
        struct arasan_sdhci_priv *priv = dev_get_priv(host->mmc->dev);
        struct arasan_sdhci_clk_data *clk_data = &priv->clk_data;
@@ -443,6 +443,8 @@ static void arasan_sdhci_set_tapdelay(struct sdhci_host *host)
                sdhci_versal_sampleclk_set_phase(host, iclk_phase);
                sdhci_versal_sdcardclk_set_phase(host, oclk_phase);
        }
+
+       return 0;
 }
 
 static void arasan_dt_read_clk_phase(struct udevice *dev, unsigned char timing,
index 1fd20ec0860bff600882dff5f2a225e3dfd5780a..c600534e879e0d12cd0533d312231be45e64c10d 100644 (file)
@@ -268,7 +268,7 @@ struct sdhci_ops {
        int     (*set_ios_post)(struct sdhci_host *host);
        void    (*set_clock)(struct sdhci_host *host, u32 div);
        int (*platform_execute_tuning)(struct mmc *host, u8 opcode);
-       void (*set_delay)(struct sdhci_host *host);
+       int (*set_delay)(struct sdhci_host *host);
        int     (*deferred_probe)(struct sdhci_host *host);
 };