aboutsummaryrefslogtreecommitdiffstats
path: root/sound/i2c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/i2c')
-rw-r--r--sound/i2c/cs8427.c15
-rw-r--r--sound/i2c/i2c.c6
-rw-r--r--sound/i2c/l3/uda1341.c3
-rw-r--r--sound/i2c/other/ak4114.c3
-rw-r--r--sound/i2c/other/ak4117.c3
5 files changed, 20 insertions, 10 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);
diff --git a/sound/i2c/i2c.c b/sound/i2c/i2c.c
index b1e74e40cba0..5c0c77dd01c3 100644
--- a/sound/i2c/i2c.c
+++ b/sound/i2c/i2c.c
@@ -49,7 +49,8 @@ static int snd_i2c_bus_free(struct snd_i2c_bus *bus)
49 struct snd_i2c_bus *slave; 49 struct snd_i2c_bus *slave;
50 struct snd_i2c_device *device; 50 struct snd_i2c_device *device;
51 51
52 snd_assert(bus != NULL, return -EINVAL); 52 if (snd_BUG_ON(!bus))
53 return -EINVAL;
53 while (!list_empty(&bus->devices)) { 54 while (!list_empty(&bus->devices)) {
54 device = snd_i2c_device(bus->devices.next); 55 device = snd_i2c_device(bus->devices.next);
55 snd_i2c_device_free(device); 56 snd_i2c_device_free(device);
@@ -113,7 +114,8 @@ int snd_i2c_device_create(struct snd_i2c_bus *bus, const char *name,
113 struct snd_i2c_device *device; 114 struct snd_i2c_device *device;
114 115
115 *rdevice = NULL; 116 *rdevice = NULL;
116 snd_assert(bus != NULL, return -EINVAL); 117 if (snd_BUG_ON(!bus))
118 return -EINVAL;
117 device = kzalloc(sizeof(*device), GFP_KERNEL); 119 device = kzalloc(sizeof(*device), GFP_KERNEL);
118 if (device == NULL) 120 if (device == NULL)
119 return -ENOMEM; 121 return -ENOMEM;
diff --git a/sound/i2c/l3/uda1341.c b/sound/i2c/l3/uda1341.c
index 1f4942ea1414..9840eb43648d 100644
--- a/sound/i2c/l3/uda1341.c
+++ b/sound/i2c/l3/uda1341.c
@@ -771,7 +771,8 @@ int __init snd_chip_uda1341_mixer_new(struct snd_card *card, struct l3_client **
771 struct l3_client *clnt; 771 struct l3_client *clnt;
772 int idx, err; 772 int idx, err;
773 773
774 snd_assert(card != NULL, return -EINVAL); 774 if (snd_BUG_ON(!card))
775 return -EINVAL;
775 776
776 clnt = kzalloc(sizeof(*clnt), GFP_KERNEL); 777 clnt = kzalloc(sizeof(*clnt), GFP_KERNEL);
777 if (clnt == NULL) 778 if (clnt == NULL)
diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c
index d20d893b3b60..0341451f814c 100644
--- a/sound/i2c/other/ak4114.c
+++ b/sound/i2c/other/ak4114.c
@@ -475,7 +475,8 @@ int snd_ak4114_build(struct ak4114 *ak4114,
475 unsigned int idx; 475 unsigned int idx;
476 int err; 476 int err;
477 477
478 snd_assert(cap_substream, return -EINVAL); 478 if (snd_BUG_ON(!cap_substream))
479 return -EINVAL;
479 ak4114->playback_substream = ply_substream; 480 ak4114->playback_substream = ply_substream;
480 ak4114->capture_substream = cap_substream; 481 ak4114->capture_substream = cap_substream;
481 for (idx = 0; idx < AK4114_CONTROLS; idx++) { 482 for (idx = 0; idx < AK4114_CONTROLS; idx++) {
diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c
index f350835ade96..2cad2d612518 100644
--- a/sound/i2c/other/ak4117.c
+++ b/sound/i2c/other/ak4117.c
@@ -431,7 +431,8 @@ int snd_ak4117_build(struct ak4117 *ak4117, struct snd_pcm_substream *cap_substr
431 unsigned int idx; 431 unsigned int idx;
432 int err; 432 int err;
433 433
434 snd_assert(cap_substream, return -EINVAL); 434 if (snd_BUG_ON(!cap_substream))
435 return -EINVAL;
435 ak4117->substream = cap_substream; 436 ak4117->substream = cap_substream;
436 for (idx = 0; idx < AK4117_CONTROLS; idx++) { 437 for (idx = 0; idx < AK4117_CONTROLS; idx++) {
437 kctl = snd_ctl_new1(&snd_ak4117_iec958_controls[idx], ak4117); 438 kctl = snd_ctl_new1(&snd_ak4117_iec958_controls[idx], ak4117);