mmc: sdhci: Return void from sdhci_runtime_suspend_host() and sdhci_runtime_resume_host()
Subsystems (9)
Adrian Hunter
maintainerPATCH 1/1 mmc: sdhci: Return void from sdhci_runtime_suspend_host() and sdhci_runtime_resume_host()
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.
--- drivers/mmc/host/sdhci-acpi.c | 8 +++----- drivers/mmc/host/sdhci-esdhc-imx.c | 10 ++-------- drivers/mmc/host/sdhci-of-at91.c | 8 ++++---- drivers/mmc/host/sdhci-pci-core.c | 19 ++++--------------- drivers/mmc/host/sdhci-pxav3.c | 8 +++----- drivers/mmc/host/sdhci-s3c.c | 10 ++++------ drivers/mmc/host/sdhci-xenon.c | 9 ++------- drivers/mmc/host/sdhci.c | 8 ++------ drivers/mmc/host/sdhci.h | 4 ++-- drivers/mmc/host/sdhci_am654.c | 8 ++------ 10 files changed, 28 insertions(+), 64 deletions(-)
drivers/mmc/host/sdhci-acpi.c +3 -5
@@ -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
drivers/mmc/host/sdhci-esdhc-imx.c +2 -8
@@ -2106,9 +2106,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);
@@ -2152,17 +2150,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:
drivers/mmc/host/sdhci-of-at91.c +4 -4
@@ -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 */
drivers/mmc/host/sdhci-pci-core.c +4 -15
@@ -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 ;
drivers/mmc/host/sdhci-pxav3.c +3 -5
@@ -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
drivers/mmc/host/sdhci-s3c.c +4 -6
@@ -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
drivers/mmc/host/sdhci-xenon.c +2 -7
@@ -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);
drivers/mmc/host/sdhci.c +2 -6
@@ -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);
drivers/mmc/host/sdhci.h +2 -2
@@ -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);
drivers/mmc/host/sdhci_am654.c +2 -6
@@ -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)
Signature · 1 line
2.48.1
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi Adrian,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linus/master]
[also build test WARNING on ulf-hansson-mmc-mirror/next v6.15 next-20250530] [cannot apply to shawnguo/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Adrian-Hunter/mmc-sdhci-Return-void-from-sdhci_runtime_suspend_host-and-sdhci_runtime_resume_host/20250530-202113 base: linus/master patch link: https://lore.kernel.org/r/20250530122018.37250-1-adrian.hunter%40intel.com patch subject: [PATCH] mmc: sdhci: Return void from sdhci_runtime_suspend_host() and sdhci_runtime_resume_host() config: i386-buildonly-randconfig-002-20250530 (https://download.01.org/0day-ci/archive/20250530/[email protected]/config) compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250530/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/mmc/host/sdhci-esdhc-imx.c:2103:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
2103 | if (host->mmc->caps2 & MMC_CAP2_CQE) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mmc/host/sdhci-esdhc-imx.c:2123:9: note: uninitialized use occurs here
2123 | return ret;
| ^~~
drivers/mmc/host/sdhci-esdhc-imx.c:2103:2: note: remove the 'if' if its condition is always true
2103 | if (host->mmc->caps2 & MMC_CAP2_CQE) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mmc/host/sdhci-esdhc-imx.c:2101:9: note: initialize the variable 'ret' to silence this warning
2101 | int ret;
| ^
| = 01 warning generated.
vim +2103 drivers/mmc/host/sdhci-esdhc-imx.c
04143fbaeb5799 Dong Aisheng 2016-07-12 2094
2788ed42cdd755 Ulf Hansson 2016-07-27 2095 #ifdef CONFIG_PM
89d7e5c131228a Dong Aisheng 2013-11-04 2096 static int sdhci_esdhc_runtime_suspend(struct device *dev)
89d7e5c131228a Dong Aisheng 2013-11-04 2097 {
89d7e5c131228a Dong Aisheng 2013-11-04 2098 struct sdhci_host *host = dev_get_drvdata(dev);
89d7e5c131228a Dong Aisheng 2013-11-04 2099 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
070e6d3ff5a696 Jisheng Zhang 2016-02-16 2100 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host);
89d7e5c131228a Dong Aisheng 2013-11-04 2101 int ret;
89d7e5c131228a Dong Aisheng 2013-11-04 2102
bb6e358169bf62 BOUGH CHEN 2019-01-07 @2103 if (host->mmc->caps2 & MMC_CAP2_CQE) {
bb6e358169bf62 BOUGH CHEN 2019-01-07 2104 ret = cqhci_suspend(host->mmc);
bb6e358169bf62 BOUGH CHEN 2019-01-07 2105 if (ret)
bb6e358169bf62 BOUGH CHEN 2019-01-07 2106 return ret;
bb6e358169bf62 BOUGH CHEN 2019-01-07 2107 }
bb6e358169bf62 BOUGH CHEN 2019-01-07 2108
5ef4a6a3b9ceac Adrian Hunter 2025-05-30 2109 sdhci_runtime_suspend_host(host);
89d7e5c131228a Dong Aisheng 2013-11-04 2110
d38dcad4e7b48f Adrian Hunter 2017-03-20 2111 if (host->tuning_mode != SDHCI_TUNING_MODE_3)
d38dcad4e7b48f Adrian Hunter 2017-03-20 2112 mmc_retune_needed(host->mmc);
d38dcad4e7b48f Adrian Hunter 2017-03-20 2113
3602785b341a95 Michael Trimarchi 2018-01-04 2114 imx_data->actual_clock = host->mmc->actual_clock;
3602785b341a95 Michael Trimarchi 2018-01-04 2115 esdhc_pltfm_set_clock(host, 0);
89d7e5c131228a Dong Aisheng 2013-11-04 2116 clk_disable_unprepare(imx_data->clk_per);
89d7e5c131228a Dong Aisheng 2013-11-04 2117 clk_disable_unprepare(imx_data->clk_ipg);
89d7e5c131228a Dong Aisheng 2013-11-04 2118 clk_disable_unprepare(imx_data->clk_ahb);
89d7e5c131228a Dong Aisheng 2013-11-04 2119
1c4989b000aeac BOUGH CHEN 2019-04-29 2120 if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS)
d1b98305916bc0 Rafael J. Wysocki 2020-02-12 2121 cpu_latency_qos_remove_request(&imx_data->pm_qos_req);
1c4989b000aeac BOUGH CHEN 2019-04-29 2122
89d7e5c131228a Dong Aisheng 2013-11-04 2123 return ret;
89d7e5c131228a Dong Aisheng 2013-11-04 2124 }
89d7e5c131228a Dong Aisheng 2013-11-04 2125 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki