Skip to content

Commit

Permalink
ALSA: hda - Skip card registration when no codec is found
Browse files Browse the repository at this point in the history
It's nonsense to register a card object when no codec is bound on it,
as we don't support the deferred codec binding.  Instead of
registering an empty card object, just skip the registration by
returning an error from azx_codec_configure().

Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jun 28, 2017
1 parent d94815f commit 1789088
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/pci/hda/hda_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,9 @@ int azx_codec_configure(struct azx *chip)
list_for_each_codec_safe(codec, next, &chip->bus) {
snd_hda_codec_configure(codec);
}

if (!azx_bus(chip)->num_codecs)
return -ENODEV;
return 0;
}
EXPORT_SYMBOL_GPL(azx_codec_configure);
Expand Down

0 comments on commit 1789088

Please sign in to comment.