summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm2000.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-11-08 10:43:41 +0000
committerMark Brown <broonie@linaro.org>2013-11-08 10:43:41 +0000
commit108145a60675ebc0e42e7964ee6666096bbf86ce (patch)
tree19266ab0500d7bb188eb53634d484054d59473d2 /sound/soc/codecs/wm2000.c
parent022aa51e3fda0b3c6688defaa859961c11c36ec8 (diff)
parentbf4edea863c435c302041cf8bb01c8b3ca729449 (diff)
downloadblackbird-op-linux-108145a60675ebc0e42e7964ee6666096bbf86ce.tar.gz
blackbird-op-linux-108145a60675ebc0e42e7964ee6666096bbf86ce.zip
Merge remote-tracking branch 'asoc/topic/warn' into asoc-next
Diffstat (limited to 'sound/soc/codecs/wm2000.c')
-rw-r--r--sound/soc/codecs/wm2000.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c
index 7fefd766b582..8ae50274ea8f 100644
--- a/sound/soc/codecs/wm2000.c
+++ b/sound/soc/codecs/wm2000.c
@@ -137,7 +137,8 @@ static int wm2000_power_up(struct i2c_client *i2c, int analogue)
unsigned long rate;
int ret;
- BUG_ON(wm2000->anc_mode != ANC_OFF);
+ if (WARN_ON(wm2000->anc_mode != ANC_OFF))
+ return -EINVAL;
dev_dbg(&i2c->dev, "Beginning power up\n");
@@ -277,7 +278,8 @@ static int wm2000_enter_bypass(struct i2c_client *i2c, int analogue)
{
struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev);
- BUG_ON(wm2000->anc_mode != ANC_ACTIVE);
+ if (WARN_ON(wm2000->anc_mode != ANC_ACTIVE))
+ return -EINVAL;
if (analogue) {
wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL,
@@ -315,7 +317,8 @@ static int wm2000_exit_bypass(struct i2c_client *i2c, int analogue)
{
struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev);
- BUG_ON(wm2000->anc_mode != ANC_BYPASS);
+ if (WARN_ON(wm2000->anc_mode != ANC_BYPASS))
+ return -EINVAL;
wm2000_write(i2c, WM2000_REG_SYS_CTL1, 0);
@@ -349,7 +352,8 @@ static int wm2000_enter_standby(struct i2c_client *i2c, int analogue)
{
struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev);
- BUG_ON(wm2000->anc_mode != ANC_ACTIVE);
+ if (WARN_ON(wm2000->anc_mode != ANC_ACTIVE))
+ return -EINVAL;
if (analogue) {
wm2000_write(i2c, WM2000_REG_ANA_VMID_PD_TIME, 248 / 4);
@@ -392,7 +396,8 @@ static int wm2000_exit_standby(struct i2c_client *i2c, int analogue)
{
struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev);
- BUG_ON(wm2000->anc_mode != ANC_STANDBY);
+ if (WARN_ON(wm2000->anc_mode != ANC_STANDBY))
+ return -EINVAL;
wm2000_write(i2c, WM2000_REG_SYS_CTL1, 0);
OpenPOWER on IntegriCloud