aboutsummaryrefslogtreecommitdiffstats
path: root/sound/i2c/i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/i2c/i2c.c')
-rw-r--r--sound/i2c/i2c.c6
1 files changed, 4 insertions, 2 deletions
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;