mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-26 11:28:28 +00:00
ASoC: mid-x86: Use WARN_ON() instead of BUG_ON()
BUG_ON() is rather useless for debugging as it leads to panic(). Use WARN_ON() and handle the error cases accordingly. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
fb2e3e7019
commit
656a22a105
@ -40,7 +40,8 @@ static DEFINE_MUTEX(sst_lock);
|
||||
|
||||
int sst_register_dsp(struct sst_device *dev)
|
||||
{
|
||||
BUG_ON(!dev);
|
||||
if (WARN_ON(!dev))
|
||||
return -EINVAL;
|
||||
if (!try_module_get(dev->dev->driver->owner))
|
||||
return -ENODEV;
|
||||
mutex_lock(&sst_lock);
|
||||
@ -59,7 +60,8 @@ EXPORT_SYMBOL_GPL(sst_register_dsp);
|
||||
|
||||
int sst_unregister_dsp(struct sst_device *dev)
|
||||
{
|
||||
BUG_ON(!dev);
|
||||
if (WARN_ON(!dev))
|
||||
return -EINVAL;
|
||||
if (dev != sst)
|
||||
return -EINVAL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user