]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: sdhci: Return void from sdhci_runtime_suspend|resume_host()
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 30 May 2025 16:56:43 +0000 (19:56 +0300)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 24 Jun 2025 10:43:22 +0000 (12:43 +0200)
It does not seem like these functions will ever need the return value,
which is presently always zero.

Simplify the usage by making the return type 'void' instead.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20250530165643.141295-1-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-acpi.c
drivers/mmc/host/sdhci-esdhc-imx.c
drivers/mmc/host/sdhci-of-at91.c
drivers/mmc/host/sdhci-pci-core.c
drivers/mmc/host/sdhci-pxav3.c
drivers/mmc/host/sdhci-s3c.c
drivers/mmc/host/sdhci-xenon.c
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h
drivers/mmc/host/sdhci_am654.c

index e6c5c82f64faadc68c85dac8310f9f5f2abd2dfd..d04c633f2b5914a5a5d2361d446aa52c3bd8dcff 100644 (file)
@@ -1028,14 +1028,11 @@ static int sdhci_acpi_runtime_suspend(struct device *dev)
 {
        struct sdhci_acpi_host *c = dev_get_drvdata(dev);
        struct sdhci_host *host = c->host;
-       int ret;
 
        if (host->tuning_mode != SDHCI_TUNING_MODE_3)
                mmc_retune_needed(host->mmc);
 
-       ret = sdhci_runtime_suspend_host(host);
-       if (ret)
-               return ret;
+       sdhci_runtime_suspend_host(host);
 
        sdhci_acpi_reset_signal_voltage_if_needed(dev);
        return 0;
@@ -1047,7 +1044,8 @@ static int sdhci_acpi_runtime_resume(struct device *dev)
 
        sdhci_acpi_byt_setting(&c->pdev->dev);
 
-       return sdhci_runtime_resume_host(c->host, 0);
+       sdhci_runtime_resume_host(c->host, 0);
+       return 0;
 }
 
 #endif
index e795e431e16e9fe8c2f415616b8e038fefc07a0d..85258359203f3d83b1dcbe4be7fd4a1a99ee70a0 100644 (file)
@@ -2132,9 +2132,7 @@ static int sdhci_esdhc_runtime_suspend(struct device *dev)
                        return ret;
        }
 
-       ret = sdhci_runtime_suspend_host(host);
-       if (ret)
-               return ret;
+       sdhci_runtime_suspend_host(host);
 
        if (host->tuning_mode != SDHCI_TUNING_MODE_3)
                mmc_retune_needed(host->mmc);
@@ -2148,7 +2146,7 @@ static int sdhci_esdhc_runtime_suspend(struct device *dev)
        if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS)
                cpu_latency_qos_remove_request(&imx_data->pm_qos_req);
 
-       return ret;
+       return 0;
 }
 
 static int sdhci_esdhc_runtime_resume(struct device *dev)
@@ -2178,17 +2176,13 @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
 
        esdhc_pltfm_set_clock(host, imx_data->actual_clock);
 
-       err = sdhci_runtime_resume_host(host, 0);
-       if (err)
-               goto disable_ipg_clk;
+       sdhci_runtime_resume_host(host, 0);
 
        if (host->mmc->caps2 & MMC_CAP2_CQE)
                err = cqhci_resume(host->mmc);
 
        return err;
 
-disable_ipg_clk:
-       clk_disable_unprepare(imx_data->clk_ipg);
 disable_per_clk:
        clk_disable_unprepare(imx_data->clk_per);
 disable_ahb_clk:
index 97988ed374672371d0df931a6250f03a506a02d1..8f12ba6a4f909601e242fbcc8fae985cb68751f8 100644 (file)
@@ -251,9 +251,8 @@ static int sdhci_at91_runtime_suspend(struct device *dev)
        struct sdhci_host *host = dev_get_drvdata(dev);
        struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
        struct sdhci_at91_priv *priv = sdhci_pltfm_priv(pltfm_host);
-       int ret;
 
-       ret = sdhci_runtime_suspend_host(host);
+       sdhci_runtime_suspend_host(host);
 
        if (host->tuning_mode != SDHCI_TUNING_MODE_3)
                mmc_retune_needed(host->mmc);
@@ -262,7 +261,7 @@ static int sdhci_at91_runtime_suspend(struct device *dev)
        clk_disable_unprepare(priv->hclock);
        clk_disable_unprepare(priv->mainck);
 
-       return ret;
+       return 0;
 }
 
 static int sdhci_at91_runtime_resume(struct device *dev)
@@ -300,7 +299,8 @@ static int sdhci_at91_runtime_resume(struct device *dev)
        }
 
 out:
-       return sdhci_runtime_resume_host(host, 0);
+       sdhci_runtime_resume_host(host, 0);
+       return 0;
 }
 #endif /* CONFIG_PM */
 
index 13a84b9309e064100caa7f1ec258907ef1de50e3..7f66d426c3c243c764eac2d6eac1468eadea5a24 100644 (file)
@@ -152,18 +152,15 @@ static int sdhci_pci_runtime_suspend_host(struct sdhci_pci_chip *chip)
 {
        struct sdhci_pci_slot *slot;
        struct sdhci_host *host;
-       int i, ret;
 
-       for (i = 0; i < chip->num_slots; i++) {
+       for (int i = 0; i < chip->num_slots; i++) {
                slot = chip->slots[i];
                if (!slot)
                        continue;
 
                host = slot->host;
 
-               ret = sdhci_runtime_suspend_host(host);
-               if (ret)
-                       goto err_pci_runtime_suspend;
+               sdhci_runtime_suspend_host(host);
 
                if (chip->rpm_retune &&
                    host->tuning_mode != SDHCI_TUNING_MODE_3)
@@ -171,26 +168,18 @@ static int sdhci_pci_runtime_suspend_host(struct sdhci_pci_chip *chip)
        }
 
        return 0;
-
-err_pci_runtime_suspend:
-       while (--i >= 0)
-               sdhci_runtime_resume_host(chip->slots[i]->host, 0);
-       return ret;
 }
 
 static int sdhci_pci_runtime_resume_host(struct sdhci_pci_chip *chip)
 {
        struct sdhci_pci_slot *slot;
-       int i, ret;
 
-       for (i = 0; i < chip->num_slots; i++) {
+       for (int i = 0; i < chip->num_slots; i++) {
                slot = chip->slots[i];
                if (!slot)
                        continue;
 
-               ret = sdhci_runtime_resume_host(slot->host, 0);
-               if (ret)
-                       return ret;
+               sdhci_runtime_resume_host(slot->host, 0);
        }
 
        return 0;
index 3fb56face3d81259b693c8569682d05c95be2880..450d2d0e0c395bb1dce370ca7bfc5ef9bb697836 100644 (file)
@@ -525,11 +525,8 @@ static int sdhci_pxav3_runtime_suspend(struct device *dev)
        struct sdhci_host *host = dev_get_drvdata(dev);
        struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
        struct sdhci_pxa *pxa = sdhci_pltfm_priv(pltfm_host);
-       int ret;
 
-       ret = sdhci_runtime_suspend_host(host);
-       if (ret)
-               return ret;
+       sdhci_runtime_suspend_host(host);
 
        if (host->tuning_mode != SDHCI_TUNING_MODE_3)
                mmc_retune_needed(host->mmc);
@@ -551,7 +548,8 @@ static int sdhci_pxav3_runtime_resume(struct device *dev)
        if (!IS_ERR(pxa->clk_core))
                clk_prepare_enable(pxa->clk_core);
 
-       return sdhci_runtime_resume_host(host, 0);
+       sdhci_runtime_resume_host(host, 0);
+       return 0;
 }
 #endif
 
index bdf4dc0d6b77b8196171b8a2b1f3bd00a93043e6..dedc4e3a217ec188f1c8671fb791c7f126a789a7 100644 (file)
@@ -714,9 +714,8 @@ static int sdhci_s3c_runtime_suspend(struct device *dev)
        struct sdhci_host *host = dev_get_drvdata(dev);
        struct sdhci_s3c *ourhost = to_s3c(host);
        struct clk *busclk = ourhost->clk_io;
-       int ret;
 
-       ret = sdhci_runtime_suspend_host(host);
+       sdhci_runtime_suspend_host(host);
 
        if (host->tuning_mode != SDHCI_TUNING_MODE_3)
                mmc_retune_needed(host->mmc);
@@ -724,7 +723,7 @@ static int sdhci_s3c_runtime_suspend(struct device *dev)
        if (ourhost->cur_clk >= 0)
                clk_disable_unprepare(ourhost->clk_bus[ourhost->cur_clk]);
        clk_disable_unprepare(busclk);
-       return ret;
+       return 0;
 }
 
 static int sdhci_s3c_runtime_resume(struct device *dev)
@@ -732,13 +731,12 @@ static int sdhci_s3c_runtime_resume(struct device *dev)
        struct sdhci_host *host = dev_get_drvdata(dev);
        struct sdhci_s3c *ourhost = to_s3c(host);
        struct clk *busclk = ourhost->clk_io;
-       int ret;
 
        clk_prepare_enable(busclk);
        if (ourhost->cur_clk >= 0)
                clk_prepare_enable(ourhost->clk_bus[ourhost->cur_clk]);
-       ret = sdhci_runtime_resume_host(host, 0);
-       return ret;
+       sdhci_runtime_resume_host(host, 0);
+       return 0;
 }
 #endif
 
index 098f0ea45cbe29bbb06fb15623dfe67cc8f91a30..15a76f8acceae66c21c75608bf12b09776166956 100644 (file)
@@ -648,11 +648,8 @@ static int xenon_runtime_suspend(struct device *dev)
        struct sdhci_host *host = dev_get_drvdata(dev);
        struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
        struct xenon_priv *priv = sdhci_pltfm_priv(pltfm_host);
-       int ret;
 
-       ret = sdhci_runtime_suspend_host(host);
-       if (ret)
-               return ret;
+       sdhci_runtime_suspend_host(host);
 
        if (host->tuning_mode != SDHCI_TUNING_MODE_3)
                mmc_retune_needed(host->mmc);
@@ -687,9 +684,7 @@ static int xenon_runtime_resume(struct device *dev)
                priv->restore_needed = false;
        }
 
-       ret = sdhci_runtime_resume_host(host, 0);
-       if (ret)
-               goto out;
+       sdhci_runtime_resume_host(host, 0);
        return 0;
 out:
        clk_disable_unprepare(pltfm_host->clk);
index f008167d186387baeaac2682379532b7a9f31606..d171c88770271b01afdf804f457c94b904af32a7 100644 (file)
@@ -3863,7 +3863,7 @@ int sdhci_resume_host(struct sdhci_host *host)
 
 EXPORT_SYMBOL_GPL(sdhci_resume_host);
 
-int sdhci_runtime_suspend_host(struct sdhci_host *host)
+void sdhci_runtime_suspend_host(struct sdhci_host *host)
 {
        unsigned long flags;
 
@@ -3880,12 +3880,10 @@ int sdhci_runtime_suspend_host(struct sdhci_host *host)
        spin_lock_irqsave(&host->lock, flags);
        host->runtime_suspended = true;
        spin_unlock_irqrestore(&host->lock, flags);
-
-       return 0;
 }
 EXPORT_SYMBOL_GPL(sdhci_runtime_suspend_host);
 
-int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset)
+void sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset)
 {
        struct mmc_host *mmc = host->mmc;
        unsigned long flags;
@@ -3931,8 +3929,6 @@ int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset)
        sdhci_enable_card_detection(host);
 
        spin_unlock_irqrestore(&host->lock, flags);
-
-       return 0;
 }
 EXPORT_SYMBOL_GPL(sdhci_runtime_resume_host);
 
index f9d65dd0f2b2faef085138a795c19cb211d6c8fc..6ccb21e50ee4cd5d254d5e8bfec8a7bde0df057b 100644 (file)
@@ -879,8 +879,8 @@ bool sdhci_enable_irq_wakeups(struct sdhci_host *host);
 void sdhci_disable_irq_wakeups(struct sdhci_host *host);
 int sdhci_suspend_host(struct sdhci_host *host);
 int sdhci_resume_host(struct sdhci_host *host);
-int sdhci_runtime_suspend_host(struct sdhci_host *host);
-int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset);
+void sdhci_runtime_suspend_host(struct sdhci_host *host);
+void sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset);
 #endif
 
 void sdhci_cqe_enable(struct mmc_host *mmc);
index 73385ff4c0f30b21dd2756ddbd7a8d3c8d412a93..e4d9faa05e11e480c9729bcd7c09120ebf2515de 100644 (file)
@@ -1082,9 +1082,7 @@ static int sdhci_am654_runtime_suspend(struct device *dev)
        if (ret)
                return ret;
 
-       ret = sdhci_runtime_suspend_host(host);
-       if (ret)
-               return ret;
+       sdhci_runtime_suspend_host(host);
 
        /* disable the clock */
        clk_disable_unprepare(pltfm_host->clk);
@@ -1106,9 +1104,7 @@ static int sdhci_am654_runtime_resume(struct device *dev)
        if (ret)
                return ret;
 
-       ret = sdhci_runtime_resume_host(host, 0);
-       if (ret)
-               return ret;
+       sdhci_runtime_resume_host(host, 0);
 
        ret = cqhci_resume(host->mmc);
        if (ret)