ALSA: hda - Don't try to bind i915 unless CONFIG_SND_HDA_I915 is set
authorTakashi Iwai <tiwai@suse.de>
Wed, 9 Dec 2015 06:21:49 +0000 (07:21 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 9 Dec 2015 06:31:36 +0000 (07:31 +0100)
commitfbaf9f9f6158a9c07652df88dd0bd68132b93292
tree5c8acfe0850cf7deeb7174cac660b1cc063b0666
parent6ee8eeb4af0e91975a7cd4795925e499cc79503c
ALSA: hda - Don't try to bind i915 unless CONFIG_SND_HDA_I915 is set

snd-hda-intel driver tries to bind with i915 audio component always
when AZX_DCAPS_I915_POWERWELL is set in the driver caps.  This was
mostly OK in the past, as the flag was applied only to a limited set
of devices, namely, Haswell and Broadwell.  On these machines, i915
graphics is almost mandatory as long as HDMI/DP is concerned.

Recently the application of i915 binding was widened to more Intel
chips.  On these chips, the chance of a kernel without i915 graphics
is much higher, and such user would hit an error like:

 snd_hda_intel 0000:00:1b.0: failed to add i915 component master (-19)

Although the error itself is harmless, it's certainly superfluous even
to try binding with i915, if we already know that there isn't any.

This patch fixes it by simply defining AZX_DCAPS_I915_POWERWELL as 0
in the case without i915.  Then all codes referring to this flag will
be optimized out by the compiler.

Fixes: 6603249dcdbb ('ALSA: hda - Enable audio component for old Intel PCH devices')
Reported-by: kernel test robot <ying.huang@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_controller.h