LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Laxman Dewangan <ldewangan@nvidia.com>,
Mark Brown <broonie@kernel.org>,
Jonathan Hunter <jonathanh@nvidia.com>,
linux-spi@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: tegra20-slink: Declare runtime suspend and resume functions conditionally
Date: Tue, 7 Sep 2021 18:58:38 +0200 [thread overview]
Message-ID: <YTeaPnxDhmia4/OB@orome.fritz.box> (raw)
In-Reply-To: <20210907045358.2138282-1-linux@roeck-us.net>
[-- Attachment #1: Type: text/plain, Size: 2230 bytes --]
On Mon, Sep 06, 2021 at 09:53:58PM -0700, Guenter Roeck wrote:
> The following build error is seen with CONFIG_PM=n.
>
> drivers/spi/spi-tegra20-slink.c:1188:12: error:
> 'tegra_slink_runtime_suspend' defined but not used
> drivers/spi/spi-tegra20-slink.c:1200:12: error:
> 'tegra_slink_runtime_resume' defined but not used
>
> Declare the functions only if PM is enabled. While at it, remove the
> unnecessary forward declarations.
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/spi/spi-tegra20-slink.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
> index ebd27f883033..8ce840c7ecc8 100644
> --- a/drivers/spi/spi-tegra20-slink.c
> +++ b/drivers/spi/spi-tegra20-slink.c
> @@ -204,9 +204,6 @@ struct tegra_slink_data {
> struct dma_async_tx_descriptor *tx_dma_desc;
> };
>
> -static int tegra_slink_runtime_suspend(struct device *dev);
> -static int tegra_slink_runtime_resume(struct device *dev);
> -
> static inline u32 tegra_slink_readl(struct tegra_slink_data *tspi,
> unsigned long reg)
> {
> @@ -1185,6 +1182,7 @@ static int tegra_slink_resume(struct device *dev)
> }
> #endif
>
> +#ifdef CONFIG_PM
> static int tegra_slink_runtime_suspend(struct device *dev)
> {
> struct spi_master *master = dev_get_drvdata(dev);
> @@ -1210,6 +1208,7 @@ static int tegra_slink_runtime_resume(struct device *dev)
> }
> return 0;
> }
> +#endif /* CONFIG_PM */
>
> static const struct dev_pm_ops slink_pm_ops = {
> SET_RUNTIME_PM_OPS(tegra_slink_runtime_suspend,
Looks like this is mostly leftover from commit e4bb903fda0e ("spi:
tegra20-slink: Improve runtime PM usage"). That's likely going to go
into v5.15 since it's been in linux-next for a couple of weeks, so this
one should go there as well.
But yeah, looks correct. On a side-note: ARCH_TEGRA always selects PM,
so we typically assume that these guards are not needed. However, since
SPI's Kconfig has these two symbols || COMPILE_TEST, that assumption is
obviously no longer true.
Anyway, this looks correct, so:
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-09-07 16:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-07 4:53 Guenter Roeck
2021-09-07 7:07 ` Geert Uytterhoeven
2021-09-07 16:58 ` Thierry Reding [this message]
2021-09-09 14:07 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YTeaPnxDhmia4/OB@orome.fritz.box \
--to=thierry.reding@gmail.com \
--cc=broonie@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux@roeck-us.net \
--subject='Re: [PATCH] spi: tegra20-slink: Declare runtime suspend and resume functions conditionally' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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).