Skip to content

Commit fdb3f29

Browse files
committed
ALSA: hda/realtek: Fix build error without CONFIG_PM
The alc_spec.power_hook is defined only with CONFIG_PM, and the recent fix overlooked it, resulting in a build error without CONFIG_PM. Fix it with the simple ifdef and set __maybe_unused for the function. We may drop the whole CONFIG_PM dependency there, but it should be done in a separate cleanup patch later. Fixes: 1e70776 ("ALSA: hda/realtek - Set GPIO3 to default at S4 state for Thinkpad with ALC1318") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Message-ID: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent a30a7a2 commit fdb3f29

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sound/pci/hda/patch_realtek.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -7204,7 +7204,7 @@ static void alc287_alc1318_playback_pcm_hook(struct hda_pcm_stream *hinfo,
72047204
}
72057205
}
72067206

7207-
static void alc287_s4_power_gpio3_default(struct hda_codec *codec)
7207+
static void __maybe_unused alc287_s4_power_gpio3_default(struct hda_codec *codec)
72087208
{
72097209
if (is_s4_suspend(codec)) {
72107210
alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */
@@ -7219,7 +7219,9 @@ static void alc287_fixup_lenovo_thinkpad_with_alc1318(struct hda_codec *codec,
72197219

72207220
if (action != HDA_FIXUP_ACT_PRE_PROBE)
72217221
return;
7222+
#ifdef CONFIG_PM
72227223
spec->power_hook = alc287_s4_power_gpio3_default;
7224+
#endif
72237225
spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook;
72247226
}
72257227

0 commit comments

Comments
 (0)