* [PATCH] mmc: tmio: hide unused tmio_mmc_clk_disable/tmio_mmc_clk_enable functions
@ 2018-01-19 14:54 Arnd Bergmann
2018-01-21 16:29 ` Masahiro Yamada
2018-01-22 7:27 ` Ulf Hansson
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-01-19 14:54 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: Arnd Bergmann, Simon Horman, Masahiro Yamada, Geert Uytterhoeven,
linux-mmc, linux-kernel
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.
Fixes: b21fc294387e ("mmc: tmio: move clk_enable/disable out of tmio_mmc_host_probe()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/mmc/host/tmio_mmc_core.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c
index 6d8719be75a8..33494241245a 100644
--- a/drivers/mmc/host/tmio_mmc_core.c
+++ b/drivers/mmc/host/tmio_mmc_core.c
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: tmio: hide unused tmio_mmc_clk_disable/tmio_mmc_clk_enable functions
2018-01-19 14:54 [PATCH] mmc: tmio: hide unused tmio_mmc_clk_disable/tmio_mmc_clk_enable functions Arnd Bergmann
@ 2018-01-21 16:29 ` Masahiro Yamada
2018-01-22 7:27 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2018-01-21 16:29 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Wolfram Sang, Ulf Hansson, Simon Horman, Geert Uytterhoeven,
linux-mmc, Linux Kernel Mailing List
2018-01-19 23:54 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
> 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.
>
> Fixes: b21fc294387e ("mmc: tmio: move clk_enable/disable out of tmio_mmc_host_probe()")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Good catch, thanks!
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: tmio: hide unused tmio_mmc_clk_disable/tmio_mmc_clk_enable functions
2018-01-19 14:54 [PATCH] mmc: tmio: hide unused tmio_mmc_clk_disable/tmio_mmc_clk_enable functions Arnd Bergmann
2018-01-21 16:29 ` Masahiro Yamada
@ 2018-01-22 7:27 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2018-01-22 7:27 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Wolfram Sang, Simon Horman, Masahiro Yamada, Geert Uytterhoeven,
linux-mmc, Linux Kernel Mailing List
On 19 January 2018 at 15:54, Arnd Bergmann <arnd@arndb.de> wrote:
> 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.
>
> Fixes: b21fc294387e ("mmc: tmio: move clk_enable/disable out of tmio_mmc_host_probe()")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks, applied for next!
Kind regards
Uffe
> ---
> drivers/mmc/host/tmio_mmc_core.c | 28 ++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c
> index 6d8719be75a8..33494241245a 100644
> --- a/drivers/mmc/host/tmio_mmc_core.c
> +++ b/drivers/mmc/host/tmio_mmc_core.c
> @@ -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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-22 7:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-19 14:54 [PATCH] mmc: tmio: hide unused tmio_mmc_clk_disable/tmio_mmc_clk_enable functions Arnd Bergmann
2018-01-21 16:29 ` Masahiro Yamada
2018-01-22 7:27 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).