mmc: tmio: hide unused tmio_mmc_clk_disable/tmio_mmc_clk_enable functions
Subsystems (2)
PATCH 1/1 mmc: tmio: hide unused tmio_mmc_clk_disable/tmio_mmc_clk_enable functions
When CONFIG_PM is disabled, we get a warning about the clock handling being unused:
drivers/mmc/host/tmio_mmc_core.c:937:13: error: 'tmio_mmc_clk_disable' defined but not used [-Werror=unused-function]
static void tmio_mmc_clk_disable(struct tmio_mmc_host *host)
^~~~~~~~~~~~~~~~~~~~
drivers/mmc/host/tmio_mmc_core.c:929:12: error: 'tmio_mmc_clk_enable' defined but not used [-Werror=unused-function]
static int tmio_mmc_clk_enable(struct tmio_mmc_host *host)
^~~~~~~~~~~~~~~~~~~As the clock handling is now done elsewhere, this is only used when power management is enabled. We could make the functions as __maybe_unused, but since there is already an #ifdef section, it seems easier to move the helpers closer to their callers.
--- drivers/mmc/host/tmio_mmc_core.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/mmc/host/tmio_mmc_core.c +14 -14
@@ -926,20 +926,6 @@ static void tmio_mmc_done_work(struct work_struct *work)tmio_mmc_finish_request (host); } -static int tmio_mmc_clk_enable (struct tmio_mmc_host *host) -{ -if (!host->clk_enable) -return -ENOTSUPP ; - -return host->clk_enable (host); -} - -static void tmio_mmc_clk_disable (struct tmio_mmc_host *host) -{ -if (host->clk_disable) - host->clk_disable (host); -} -static void tmio_mmc_power_on (struct tmio_mmc_host *host,unsigned short vdd) {struct mmc_host *mmc = host->mmc;
@@ -1337,6 +1323,20 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)EXPORT_SYMBOL_GPL (tmio_mmc_host_remove);#ifdef CONFIG_PM +static int tmio_mmc_clk_enable (struct tmio_mmc_host *host) +{ +if (!host->clk_enable) +return -ENOTSUPP ; + +return host->clk_enable (host); +} + +static void tmio_mmc_clk_disable (struct tmio_mmc_host *host) +{ +if (host->clk_disable) + host->clk_disable (host); +} +int tmio_mmc_host_runtime_suspend (struct device *dev) {struct tmio_mmc_host *host =dev_get_drvdata (dev);
Signature · 1 line
2.9.0
2018-01-19 23:54 GMT+09:00 Arnd Bergmann <[email protected]>:
Quoted 10 lines
When
CONFIG_PMis disabled, we get a warning about the clock handling being unused:
drivers/mmc/host/tmio_mmc_core.c:937:13: error: 'tmio_mmc_clk_disable' defined but not used [-Werror=unused-function]
static voidtmio_mmc_clk_disable(struct tmio_mmc_host *host)^~~~~~~~~~~~~~~~~~~~ drivers/mmc/host/tmio_mmc_core.c:929:12: error: 'tmio_mmc_clk_enable' defined but not used [-Werror=unused-function] static int tmio_mmc_clk_enable(struct tmio_mmc_host *host) ^~~~~~~~~~~~~~~~~~~
Quoted 8 lines
As the clock handling is now done elsewhere, this is only used when power management is enabled. We could make the functions as
__maybe_unused, but since there is already an #ifdef section, it seems easier to move the helpers closer to their callers.Fixes b21fc294387e ("mmc: tmio: move clk_enable/disable out of tmio_mmc_host_probe()")Signed-off-by Arnd Bergmann <[email protected]>---
Good catch, thanks!
Signature · 2 lines
Best Regards Masahiro Yamada
Ulf Hansson
AppliedQuoted 10 lines · Arnd Bergmann
When
CONFIG_PMis disabled, we get a warning about the clock handling being unused:
drivers/mmc/host/tmio_mmc_core.c:937:13: error: 'tmio_mmc_clk_disable' defined but not used [-Werror=unused-function]
static voidtmio_mmc_clk_disable(struct tmio_mmc_host *host)^~~~~~~~~~~~~~~~~~~~ drivers/mmc/host/tmio_mmc_core.c:929:12: error: 'tmio_mmc_clk_enable' defined but not used [-Werror=unused-function] static int tmio_mmc_clk_enable(struct tmio_mmc_host *host) ^~~~~~~~~~~~~~~~~~~
Quoted 7 lines
As the clock handling is now done elsewhere, this is only used when power management is enabled. We could make the functions as
__maybe_unused, but since there is already an #ifdef section, it seems easier to move the helpers closer to their callers.Fixes b21fc294387e ("mmc: tmio: move clk_enable/disable out of tmio_mmc_host_probe()")Signed-off-by Arnd Bergmann <[email protected]>
Thanks, applied for next!
Kind regards
Uffe
Quoted 53 lines
--- drivers/mmc/host/tmio_mmc_core.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)drivers/mmc/host/tmio_mmc_core.c +14
-15@@ -926,20 +926,6 @@ static void tmio_mmc_done_work(struct work_struct *work)tmio_mmc_finish_request (host); } -static int tmio_mmc_clk_enable (struct tmio_mmc_host *host) -{ -if (!host->clk_enable) -return -ENOTSUPP ; - -return host->clk_enable (host); -} - -static void tmio_mmc_clk_disable (struct tmio_mmc_host *host) -{ -if (host->clk_disable) - host->clk_disable (host); -} -static void tmio_mmc_power_on (struct tmio_mmc_host *host,unsigned short vdd) {struct mmc_host *mmc = host->mmc;@@ -1337,6 +1323,20 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)EXPORT_SYMBOL_GPL (tmio_mmc_host_remove);#ifdef CONFIG_PM +static int tmio_mmc_clk_enable (struct tmio_mmc_host *host) +{ +if (!host->clk_enable) +return -ENOTSUPP ; + +return host->clk_enable (host); +} + +static void tmio_mmc_clk_disable (struct tmio_mmc_host *host) +{ +if (host->clk_disable) + host->clk_disable (host); +} +int tmio_mmc_host_runtime_suspend (struct device *dev) {struct tmio_mmc_host *host =dev_get_drvdata (dev); --2.9.0