aboutsummaryrefslogtreecommitdiffstats
path: root/sound/i2c/cs8427.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-08-08 11:12:47 -0400
committerJaroslav Kysela <perex@perex.cz>2008-08-13 05:46:40 -0400
commit5e246b850df563224be26f1d409cf66fd6c968df (patch)
tree970e7faf60b86cb2c489a08ca506075c398165e5 /sound/i2c/cs8427.c
parentda3cec35dd3c31d8706db4bf379372ce70d92118 (diff)
ALSA: Kill snd_assert() in other places
Kill snd_assert() in other places, either removed or replaced with if () with snd_BUG_ON(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/i2c/cs8427.c')
-rw-r--r--sound/i2c/cs8427.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/i2c/cs8427.c b/sound/i2c/cs8427.c
index 9c3d361accfb..020a5d512472 100644
--- a/sound/i2c/cs8427.c
+++ b/sound/i2c/cs8427.c
@@ -314,7 +314,8 @@ static void snd_cs8427_reset(struct snd_i2c_device *cs8427)
314 unsigned long end_time; 314 unsigned long end_time;
315 int data, aes3input = 0; 315 int data, aes3input = 0;
316 316
317 snd_assert(cs8427, return); 317 if (snd_BUG_ON(!cs8427))
318 return;
318 chip = cs8427->private_data; 319 chip = cs8427->private_data;
319 snd_i2c_lock(cs8427->bus); 320 snd_i2c_lock(cs8427->bus);
320 if ((chip->regmap[CS8427_REG_CLOCKSOURCE] & CS8427_RXDAES3INPUT) == 321 if ((chip->regmap[CS8427_REG_CLOCKSOURCE] & CS8427_RXDAES3INPUT) ==
@@ -526,7 +527,8 @@ int snd_cs8427_iec958_build(struct snd_i2c_device *cs8427,
526 unsigned int idx; 527 unsigned int idx;
527 int err; 528 int err;
528 529
529 snd_assert(play_substream && cap_substream, return -EINVAL); 530 if (snd_BUG_ON(!play_substream || !cap_substream))
531 return -EINVAL;
530 for (idx = 0; idx < ARRAY_SIZE(snd_cs8427_iec958_controls); idx++) { 532 for (idx = 0; idx < ARRAY_SIZE(snd_cs8427_iec958_controls); idx++) {
531 kctl = snd_ctl_new1(&snd_cs8427_iec958_controls[idx], cs8427); 533 kctl = snd_ctl_new1(&snd_cs8427_iec958_controls[idx], cs8427);
532 if (kctl == NULL) 534 if (kctl == NULL)
@@ -543,7 +545,8 @@ int snd_cs8427_iec958_build(struct snd_i2c_device *cs8427,
543 545
544 chip->playback.substream = play_substream; 546 chip->playback.substream = play_substream;
545 chip->capture.substream = cap_substream; 547 chip->capture.substream = cap_substream;
546 snd_assert(chip->playback.pcm_ctl, return -EIO); 548 if (snd_BUG_ON(!chip->playback.pcm_ctl))
549 return -EIO;
547 return 0; 550 return 0;
548} 551}
549 552
@@ -553,7 +556,8 @@ int snd_cs8427_iec958_active(struct snd_i2c_device *cs8427, int active)
553{ 556{
554 struct cs8427 *chip; 557 struct cs8427 *chip;
555 558
556 snd_assert(cs8427, return -ENXIO); 559 if (snd_BUG_ON(!cs8427))
560 return -ENXIO;
557 chip = cs8427->private_data; 561 chip = cs8427->private_data;
558 if (active) 562 if (active)
559 memcpy(chip->playback.pcm_status, 563 memcpy(chip->playback.pcm_status,
@@ -573,7 +577,8 @@ int snd_cs8427_iec958_pcm(struct snd_i2c_device *cs8427, unsigned int rate)
573 char *status; 577 char *status;
574 int err, reset; 578 int err, reset;
575 579
576 snd_assert(cs8427, return -ENXIO); 580 if (snd_BUG_ON(!cs8427))
581 return -ENXIO;
577 chip = cs8427->private_data; 582 chip = cs8427->private_data;
578 status = chip->playback.pcm_status; 583 status = chip->playback.pcm_status;
579 snd_i2c_lock(cs8427->bus); 584 snd_i2c_lock(cs8427->bus);