Skip to content

Commit 3fa1370

Browse files
arndbgregkh
authored andcommitted
ALSA: hda: realtek: fix incorrect IS_REACHABLE() usage
commit d0bbe332669c5db32c8c92bc967f8e7f8d460ddf upstream. The alternative path leads to a build error after a recent change: sound/pci/hda/patch_realtek.c: In function 'alc233_fixup_lenovo_low_en_micmute_led': include/linux/stddef.h:9:14: error: called object is not a function or function pointer 9 | #define NULL ((void *)0) | ^ sound/pci/hda/patch_realtek.c:5041:49: note: in expansion of macro 'NULL' 5041 | #define alc233_fixup_lenovo_line2_mic_hotkey NULL | ^~~~ sound/pci/hda/patch_realtek.c:5063:9: note: in expansion of macro 'alc233_fixup_lenovo_line2_mic_hotkey' 5063 | alc233_fixup_lenovo_line2_mic_hotkey(codec, fix, action); Using IS_REACHABLE() is somewhat questionable here anyway since it leads to the input code not working when the HDA driver is builtin but input is in a loadable module. Replace this with a hard compile-time dependency on CONFIG_INPUT. In practice this won't chance much other than solve the compiler error because it is rare to require sound output but no input support. Fixes: f603b159231b ("ALSA: hda/realtek - add supported Mic Mute LED for Lenovo platform") Signed-off-by: Arnd Bergmann <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8427e0b commit 3fa1370

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

sound/pci/hda/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ comment "Set to Y if you want auto-loading the side codec driver"
132132

133133
config SND_HDA_CODEC_REALTEK
134134
tristate "Build Realtek HD-audio codec support"
135+
depends on INPUT
135136
select SND_HDA_GENERIC
136137
select SND_HDA_GENERIC_LEDS
137138
help

sound/pci/hda/patch_realtek.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4862,7 +4862,6 @@ static void alc298_fixup_samsung_amp(struct hda_codec *codec,
48624862
}
48634863
}
48644864

4865-
#if IS_REACHABLE(CONFIG_INPUT)
48664865
static void gpio2_mic_hotkey_event(struct hda_codec *codec,
48674866
struct hda_jack_callback *event)
48684867
{
@@ -4971,10 +4970,6 @@ static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
49714970
spec->kb_dev = NULL;
49724971
}
49734972
}
4974-
#else /* INPUT */
4975-
#define alc280_fixup_hp_gpio2_mic_hotkey NULL
4976-
#define alc233_fixup_lenovo_line2_mic_hotkey NULL
4977-
#endif /* INPUT */
49784973

49794974
static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
49804975
const struct hda_fixup *fix, int action)

0 commit comments

Comments
 (0)