linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: tegra20-slink: Declare runtime suspend and resume functions conditionally
@ 2021-09-07  4:53 Guenter Roeck
  2021-09-07  7:07 ` Geert Uytterhoeven
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Guenter Roeck @ 2021-09-07  4:53 UTC (permalink / raw)
  To: Laxman Dewangan
  Cc: Mark Brown, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-tegra, linux-kernel, Guenter Roeck

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,
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] spi: tegra20-slink: Declare runtime suspend and resume functions conditionally
  2021-09-07  4:53 [PATCH] spi: tegra20-slink: Declare runtime suspend and resume functions conditionally Guenter Roeck
@ 2021-09-07  7:07 ` Geert Uytterhoeven
  2021-09-07 16:58 ` Thierry Reding
  2021-09-09 14:07 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2021-09-07  7:07 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Laxman Dewangan, Mark Brown, Thierry Reding, Jonathan Hunter,
	linux-spi, linux-tegra, Linux Kernel Mailing List

On Tue, Sep 7, 2021 at 6:56 AM Guenter Roeck <linux@roeck-us.net> 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>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] spi: tegra20-slink: Declare runtime suspend and resume functions conditionally
  2021-09-07  4:53 [PATCH] spi: tegra20-slink: Declare runtime suspend and resume functions conditionally Guenter Roeck
  2021-09-07  7:07 ` Geert Uytterhoeven
@ 2021-09-07 16:58 ` Thierry Reding
  2021-09-09 14:07 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2021-09-07 16:58 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Laxman Dewangan, Mark Brown, Jonathan Hunter, linux-spi,
	linux-tegra, linux-kernel

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] spi: tegra20-slink: Declare runtime suspend and resume functions conditionally
  2021-09-07  4:53 [PATCH] spi: tegra20-slink: Declare runtime suspend and resume functions conditionally Guenter Roeck
  2021-09-07  7:07 ` Geert Uytterhoeven
  2021-09-07 16:58 ` Thierry Reding
@ 2021-09-09 14:07 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2021-09-09 14:07 UTC (permalink / raw)
  To: Guenter Roeck, Laxman Dewangan
  Cc: Mark Brown, linux-kernel, linux-tegra, Thierry Reding,
	Jonathan Hunter, linux-spi

On Mon, 6 Sep 2021 21:53:58 -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
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: tegra20-slink: Declare runtime suspend and resume functions conditionally
      commit: 2bab94090b01bc593d8bc25f68df41f198721173

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-09 14:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07  4:53 [PATCH] spi: tegra20-slink: Declare runtime suspend and resume functions conditionally Guenter Roeck
2021-09-07  7:07 ` Geert Uytterhoeven
2021-09-07 16:58 ` Thierry Reding
2021-09-09 14:07 ` Mark Brown

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).