ALSA: usb-audio: Fix build with CONFIG_INPUT=n
PATCH 1/1 ALSA: usb-audio: Fix build with CONFIG_INPUT=n
The recent addition of DualSense mixer quirk relies on the input device handle, and the build can fail if CONFIG_INPUT isn't set. Put (rather ugly) workarounds to wrap with IS_REACHABLE() for avoiding the build error.
--- sound/usb/mixer_quirks.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/usb/mixer_quirks.c +4 -0
@@ -532,6 +532,7 @@ static int snd_emu0204_controls_create(struct usb_mixer_interface *mixer) &snd_emu0204_control, NULL); } +#if IS_REACHABLE (CONFIG_INPUT )/* * Sony DualSense controller (PS5) jack detection *
@@ -788,6 +789,7 @@ static int snd_dualsense_controls_create(struct usb_mixer_interface *mixer) return snd_dualsense_jack_create(mixer, "Headset Mic Jack", false); } +#endif /* IS_REACHABLE(CONFIG_INPUT) */ /* ASUS Xonar U1 / U3 controls */
@@ -4331,10 +4333,12 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) err =snd_emu0204_controls_create (mixer);break ; +#if IS_REACHABLE (CONFIG_INPUT )case USB_ID (0x054c ,0x0ce6 ):/* Sony DualSense controller (PS5) */ case USB_ID (0x054c ,0x0df2 ):/* Sony DualSense Edge controller (PS5) */ err =snd_dualsense_controls_create (mixer);break ; +#endif /* IS_REACHABLE(CONFIG_INPUT) */ case USB_ID (0x0763 ,0x2030 ):/* M-Audio Fast Track C400 */ case USB_ID (0x0763 ,0x2031 ):/* M-Audio Fast Track C400 */
Signature · 1 line
2.49.0
Hi Takashi,
Quoted 36 lines · Takashi Iwai
The recent addition of DualSense mixer quirk relies on the input device handle, and the build can fail if
CONFIG_INPUTisn't set. Put (rather ugly) workarounds to wrap withIS_REACHABLE()for avoiding the build error.Fixes 79d561c4ec04 ("ALSA: usb-audio: Add mixer quirk for Sony DualSense PS5")Reported-by kernel test robot <[email protected]>Signed-off-by Takashi Iwai <[email protected]>--- sound/usb/mixer_quirks.c | 4 ++++ 1 file changed, 4 insertions(+)sound/usb/mixer_quirks.c +2
-0@@ -532,6 +532,7 @@ static int snd_emu0204_controls_create(struct usb_mixer_interface *mixer) &snd_emu0204_control, NULL); } +#if IS_REACHABLE (CONFIG_INPUT )/* * Sony DualSense controller (PS5) jack detection * @@ -788,6 +789,7 @@ static int snd_dualsense_controls_create(struct usb_mixer_interface *mixer) return snd_dualsense_jack_create(mixer, "Headset Mic Jack", false); } +#endif /* IS_REACHABLE(CONFIG_INPUT) */ /* ASUS Xonar U1 / U3 controls */ @@ -4331,10 +4333,12 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) err =snd_emu0204_controls_create (mixer);break ;
sound/usb/mixer_quirks.c int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) · line 4344
Quoted 10 lines
sound/usb/mixer_quirks.c +2
-0+#if IS_REACHABLE (CONFIG_INPUT )case USB_ID (0x054c ,0x0ce6 ):/* Sony DualSense controller (PS5) */ case USB_ID (0x054c ,0x0df2 ):/* Sony DualSense Edge controller (PS5) */ err =snd_dualsense_controls_create (mixer);break ; +#endif /* IS_REACHABLE(CONFIG_INPUT) */ case USB_ID (0x0763 ,0x2030 ):/* M-Audio Fast Track C400 */ case USB_ID (0x0763 ,0x2031 ):/* M-Audio Fast Track C400 */
I've seen the build issue report earlier today and planned to investigate, but you beat me to it, so thanks for the quick fix!
I reproduced the linker errors on a minimal kernel configuration with CONFIG_INPUT not being set and I confirm the build passes after applying the patch.
Quoted 54 lines · Cristian Ciocaltea
Hi Takashi,
Quoted 36 lines · Takashi Iwai
The recent addition of DualSense mixer quirk relies on the input device handle, and the build can fail if
CONFIG_INPUTisn't set. Put (rather ugly) workarounds to wrap withIS_REACHABLE()for avoiding the build error.Fixes 79d561c4ec04 ("ALSA: usb-audio: Add mixer quirk for Sony DualSense PS5")Reported-by kernel test robot <[email protected]>Signed-off-by Takashi Iwai <[email protected]>--- sound/usb/mixer_quirks.c | 4 ++++ 1 file changed, 4 insertions(+)sound/usb/mixer_quirks.c +2
-0@@ -532,6 +532,7 @@ static int snd_emu0204_controls_create(struct usb_mixer_interface *mixer) &snd_emu0204_control, NULL); } +#if IS_REACHABLE (CONFIG_INPUT )/* * Sony DualSense controller (PS5) jack detection * @@ -788,6 +789,7 @@ static int snd_dualsense_controls_create(struct usb_mixer_interface *mixer) return snd_dualsense_jack_create(mixer, "Headset Mic Jack", false); } +#endif /* IS_REACHABLE(CONFIG_INPUT) */ /* ASUS Xonar U1 / U3 controls */ @@ -4331,10 +4333,12 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) err =snd_emu0204_controls_create (mixer);break ;sound/usb/mixer_quirks.c int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) · line 4344
Quoted 10 lines
sound/usb/mixer_quirks.c +2
-0+#if IS_REACHABLE (CONFIG_INPUT )case USB_ID (0x054c ,0x0ce6 ):/* Sony DualSense controller (PS5) */ case USB_ID (0x054c ,0x0df2 ):/* Sony DualSense Edge controller (PS5) */ err =snd_dualsense_controls_create (mixer);break ; +#endif /* IS_REACHABLE(CONFIG_INPUT) */ case USB_ID (0x0763 ,0x2030 ):/* M-Audio Fast Track C400 */ case USB_ID (0x0763 ,0x2031 ):/* M-Audio Fast Track C400 */ I've seen the build issue report earlier today and planned to investigate, but you beat me to it, so thanks for the quick fix!
Quoted 5 lines
I reproduced the linker errors on a minimal kernel configuration with
CONFIG_INPUTnot being set and I confirm the build passes after applying the patch.Reviewed-by Cristian Ciocaltea <[email protected]>
Thanks for confirmation. Now queued.
Takashi