diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-11-05 18:40:01 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-07 20:55:11 +0100 |
commit | 656a22a105c8135a515daae3d79ede7b472c18ec (patch) | |
tree | fccf6c9e6f42803215bc11c2d1ea191025382ec4 | |
parent | ASoC: wm9713: Use WARN_ON() instead of BUG_ON() (diff) | |
download | linux-656a22a105c8135a515daae3d79ede7b472c18ec.tar.xz linux-656a22a105c8135a515daae3d79ede7b472c18ec.zip |
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>
-rw-r--r-- | sound/soc/mid-x86/sst_platform.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/soc/mid-x86/sst_platform.c b/sound/soc/mid-x86/sst_platform.c index 392fc0b8f5b8..b6b5eb698d33 100644 --- a/sound/soc/mid-x86/sst_platform.c +++ b/sound/soc/mid-x86/sst_platform.c @@ -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; |