Skip to content
Commit 81033c6b authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: core: Warn on empty module

The module argument passed to snd_card_new() must be a valid non-NULL
pointer when the module support is enabled.  Since ASoC driver passes
the argument from each snd_soc_card definition, one may forget to set
the owner field and lead to a NULL module easily.

For catching such an overlook, add a WARN_ON() in snd_card_new().
Also, put the card->module assignment in the ifdef block for a very
minor optimization.

Link: https://lore.kernel.org/r/20200624160300.21703-1-tiwai@suse.de


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent c7440acc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment