Skip to content

Commit d0bbe33

Browse files
arndbtiwai
authored andcommitted
ALSA: hda: realtek: fix incorrect IS_REACHABLE() usage
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: f603b15 ("ALSA: hda/realtek - add supported Mic Mute LED for Lenovo platform") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://patch.msgid.link/20250304142620.582191-1-arnd@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 172a0f5 commit d0bbe33

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
@@ -222,6 +222,7 @@ comment "Set to Y if you want auto-loading the side codec driver"
222222

223223
config SND_HDA_CODEC_REALTEK
224224
tristate "Build Realtek HD-audio codec support"
225+
depends on INPUT
225226
select SND_HDA_GENERIC
226227
select SND_HDA_GENERIC_LEDS
227228
select SND_HDA_SCODEC_COMPONENT

sound/pci/hda/patch_realtek.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4927,7 +4927,6 @@ static void alc298_fixup_samsung_amp_v2_4_amps(struct hda_codec *codec,
49274927
alc298_samsung_v2_init_amps(codec, 4);
49284928
}
49294929

4930-
#if IS_REACHABLE(CONFIG_INPUT)
49314930
static void gpio2_mic_hotkey_event(struct hda_codec *codec,
49324931
struct hda_jack_callback *event)
49334932
{
@@ -5036,10 +5035,6 @@ static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
50365035
spec->kb_dev = NULL;
50375036
}
50385037
}
5039-
#else /* INPUT */
5040-
#define alc280_fixup_hp_gpio2_mic_hotkey NULL
5041-
#define alc233_fixup_lenovo_line2_mic_hotkey NULL
5042-
#endif /* INPUT */
50435038

50445039
static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
50455040
const struct hda_fixup *fix, int action)

0 commit comments

Comments
 (0)