linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda/tegra: avoid build error without CONFIG_PM
@ 2019-03-04 20:33 Arnd Bergmann
  2019-03-05 12:20 ` Thierry Reding
  2019-03-13 10:29 ` Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2019-03-04 20:33 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Thierry Reding, Jonathan Hunter
  Cc: Arnd Bergmann, Sameer Pujar, Mohan Kumar D, Ravindra Lokhande,
	Pierre-Louis Bossart, alsa-devel, linux-tegra, linux-kernel

The #ifdef protection around the PM functions is wrong, leading to
a failed reference in some configurations:

sound/pci/hda/hda_tegra.c: In function 'hda_tegra_runtime_suspend':
sound/pci/hda/hda_tegra.c:273:2: error: implicit declaration of function 'hda_tegra_disable_clocks'; did you mean 'hda_tegra_enable_clocks'? [-Werror=implicit-function-declaration]

Better remove the #ifdefs entirely and rely on the compiler silently
dropping unused functions marked __maybe_unused.

Fixes: 707e0759f2f4 ("ALSA: hda/tegra: implement runtime suspend/resume")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 sound/pci/hda/hda_tegra.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
index dbd8da5685cb..3d68f9ef7694 100644
--- a/sound/pci/hda/hda_tegra.c
+++ b/sound/pci/hda/hda_tegra.c
@@ -219,7 +219,6 @@ static int hda_tegra_enable_clocks(struct hda_tegra *data)
 	return rc;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static void hda_tegra_disable_clocks(struct hda_tegra *data)
 {
 	clk_disable_unprepare(data->hda2hdmi_clk);
@@ -230,7 +229,7 @@ static void hda_tegra_disable_clocks(struct hda_tegra *data)
 /*
  * power management
  */
-static int hda_tegra_suspend(struct device *dev)
+static int __maybe_unused hda_tegra_suspend(struct device *dev)
 {
 	struct snd_card *card = dev_get_drvdata(dev);
 	int rc;
@@ -243,7 +242,7 @@ static int hda_tegra_suspend(struct device *dev)
 	return 0;
 }
 
-static int hda_tegra_resume(struct device *dev)
+static int __maybe_unused hda_tegra_resume(struct device *dev)
 {
 	struct snd_card *card = dev_get_drvdata(dev);
 	int rc;
@@ -255,10 +254,8 @@ static int hda_tegra_resume(struct device *dev)
 
 	return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
-#ifdef CONFIG_PM
-static int hda_tegra_runtime_suspend(struct device *dev)
+static int __maybe_unused hda_tegra_runtime_suspend(struct device *dev)
 {
 	struct snd_card *card = dev_get_drvdata(dev);
 	struct azx *chip = card->private_data;
@@ -275,7 +272,7 @@ static int hda_tegra_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int hda_tegra_runtime_resume(struct device *dev)
+static int __maybe_unused hda_tegra_runtime_resume(struct device *dev)
 {
 	struct snd_card *card = dev_get_drvdata(dev);
 	struct azx *chip = card->private_data;
@@ -292,7 +289,6 @@ static int hda_tegra_runtime_resume(struct device *dev)
 
 	return 0;
 }
-#endif /* CONFIG_PM */
 
 static const struct dev_pm_ops hda_tegra_pm = {
 	SET_SYSTEM_SLEEP_PM_OPS(hda_tegra_suspend, hda_tegra_resume)
-- 
2.20.0


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

* Re: [PATCH] ALSA: hda/tegra: avoid build error without CONFIG_PM
  2019-03-04 20:33 [PATCH] ALSA: hda/tegra: avoid build error without CONFIG_PM Arnd Bergmann
@ 2019-03-05 12:20 ` Thierry Reding
  2019-03-13 10:29 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2019-03-05 12:20 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jaroslav Kysela, Takashi Iwai, Jonathan Hunter, Sameer Pujar,
	Mohan Kumar D, Ravindra Lokhande, Pierre-Louis Bossart,
	alsa-devel, linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 852 bytes --]

On Mon, Mar 04, 2019 at 09:33:25PM +0100, Arnd Bergmann wrote:
> The #ifdef protection around the PM functions is wrong, leading to
> a failed reference in some configurations:
> 
> sound/pci/hda/hda_tegra.c: In function 'hda_tegra_runtime_suspend':
> sound/pci/hda/hda_tegra.c:273:2: error: implicit declaration of function 'hda_tegra_disable_clocks'; did you mean 'hda_tegra_enable_clocks'? [-Werror=implicit-function-declaration]
> 
> Better remove the #ifdefs entirely and rely on the compiler silently
> dropping unused functions marked __maybe_unused.
> 
> Fixes: 707e0759f2f4 ("ALSA: hda/tegra: implement runtime suspend/resume")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  sound/pci/hda/hda_tegra.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] ALSA: hda/tegra: avoid build error without CONFIG_PM
  2019-03-04 20:33 [PATCH] ALSA: hda/tegra: avoid build error without CONFIG_PM Arnd Bergmann
  2019-03-05 12:20 ` Thierry Reding
@ 2019-03-13 10:29 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2019-03-13 10:29 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Thierry Reding, Jonathan Hunter, Jaroslav Kysela, alsa-devel,
	Pierre-Louis Bossart, Mohan Kumar D, Ravindra Lokhande,
	Sameer Pujar, linux-kernel, linux-tegra

On Mon, 04 Mar 2019 21:33:25 +0100,
Arnd Bergmann wrote:
> 
> The #ifdef protection around the PM functions is wrong, leading to
> a failed reference in some configurations:
> 
> sound/pci/hda/hda_tegra.c: In function 'hda_tegra_runtime_suspend':
> sound/pci/hda/hda_tegra.c:273:2: error: implicit declaration of function 'hda_tegra_disable_clocks'; did you mean 'hda_tegra_enable_clocks'? [-Werror=implicit-function-declaration]
> 
> Better remove the #ifdefs entirely and rely on the compiler silently
> dropping unused functions marked __maybe_unused.
> 
> Fixes: 707e0759f2f4 ("ALSA: hda/tegra: implement runtime suspend/resume")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied now.  Thanks.


Takashi

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

end of thread, other threads:[~2019-03-13 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-04 20:33 [PATCH] ALSA: hda/tegra: avoid build error without CONFIG_PM Arnd Bergmann
2019-03-05 12:20 ` Thierry Reding
2019-03-13 10:29 ` Takashi Iwai

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