diff mbox series

[2/2] ALSA: hda/analog - Sink ad198x_shutup() and shuffle CONFIG_PM guards

Message ID 20210818012705.311963-2-nathan@kernel.org
State Accepted
Commit d2d837563743590cbf07bf786941e73a8c40b031
Headers show
Series [1/2] ALSA: hda/sigmatel - Sink stac_shutup() into stac_suspend() | expand

Commit Message

Nathan Chancellor Aug. 18, 2021, 1:27 a.m. UTC
When CONFIG_PM is not set, there is an unused function warning:

sound/pci/hda/patch_analog.c:115:13: warning: unused function
'ad198x_shutup' [-Wunused-function]
static void ad198x_shutup(struct hda_codec *codec)
            ^
1 warning generated.

Sink ad198x_shutup() into ad198x_suspend(), as it is only called in that
one space. Move the CONFIG_PM guards above ad198x_power_eapd_write() as
it is only called in ad198x_power_eapd(), which is in turn only called
in ad198x_power_eapd(). Those two functions are large enough that they
are left alone.

Fixes: 327b34f2a97d ("ALSA: hda: Nuke unused reboot_notify callback")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 sound/pci/hda/patch_analog.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index a356e1662929..8afe6000f7da 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -72,7 +72,7 @@  static int create_beep_ctls(struct hda_codec *codec)
 #define create_beep_ctls(codec)		0
 #endif
 
-
+#ifdef CONFIG_PM
 static void ad198x_power_eapd_write(struct hda_codec *codec, hda_nid_t front,
 				hda_nid_t hp)
 {
@@ -112,16 +112,10 @@  static void ad198x_power_eapd(struct hda_codec *codec)
 	}
 }
 
-static void ad198x_shutup(struct hda_codec *codec)
+static int ad198x_suspend(struct hda_codec *codec)
 {
 	snd_hda_shutup_pins(codec);
 	ad198x_power_eapd(codec);
-}
-
-#ifdef CONFIG_PM
-static int ad198x_suspend(struct hda_codec *codec)
-{
-	ad198x_shutup(codec);
 	return 0;
 }
 #endif