aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/device.c')
-rw-r--r--sound/core/device.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sound/core/device.c b/sound/core/device.c
index 18c71f913d2a..ca00ad7740c9 100644
--- a/sound/core/device.c
+++ b/sound/core/device.c
@@ -28,7 +28,7 @@
28/** 28/**
29 * snd_device_new - create an ALSA device component 29 * snd_device_new - create an ALSA device component
30 * @card: the card instance 30 * @card: the card instance
31 * @type: the device type, SNDRV_DEV_TYPE_XXX 31 * @type: the device type, SNDRV_DEV_XXX
32 * @device_data: the data pointer of this device 32 * @device_data: the data pointer of this device
33 * @ops: the operator table 33 * @ops: the operator table
34 * 34 *
@@ -46,7 +46,9 @@ int snd_device_new(snd_card_t *card, snd_device_type_t type,
46{ 46{
47 snd_device_t *dev; 47 snd_device_t *dev;
48 48
49 snd_assert(card != NULL && device_data != NULL && ops != NULL, return -ENXIO); 49 snd_assert(card != NULL, return -ENXIO);
50 snd_assert(device_data != NULL, return -ENXIO);
51 snd_assert(ops != NULL, return -ENXIO);
50 dev = kcalloc(1, sizeof(*dev), GFP_KERNEL); 52 dev = kcalloc(1, sizeof(*dev), GFP_KERNEL);
51 if (dev == NULL) 53 if (dev == NULL)
52 return -ENOMEM; 54 return -ENOMEM;
@@ -102,7 +104,7 @@ int snd_device_free(snd_card_t *card, void *device_data)
102} 104}
103 105
104/** 106/**
105 * snd_device_free - disconnect the device 107 * snd_device_disconnect - disconnect the device
106 * @card: the card instance 108 * @card: the card instance
107 * @device_data: the data pointer to disconnect 109 * @device_data: the data pointer to disconnect
108 * 110 *
@@ -118,7 +120,7 @@ int snd_device_disconnect(snd_card_t *card, void *device_data)
118{ 120{
119 struct list_head *list; 121 struct list_head *list;
120 snd_device_t *dev; 122 snd_device_t *dev;
121 123
122 snd_assert(card != NULL, return -ENXIO); 124 snd_assert(card != NULL, return -ENXIO);
123 snd_assert(device_data != NULL, return -ENXIO); 125 snd_assert(device_data != NULL, return -ENXIO);
124 list_for_each(list, &card->devices) { 126 list_for_each(list, &card->devices) {
@@ -154,8 +156,9 @@ int snd_device_register(snd_card_t *card, void *device_data)
154 struct list_head *list; 156 struct list_head *list;
155 snd_device_t *dev; 157 snd_device_t *dev;
156 int err; 158 int err;
157 159
158 snd_assert(card != NULL && device_data != NULL, return -ENXIO); 160 snd_assert(card != NULL, return -ENXIO);
161 snd_assert(device_data != NULL, return -ENXIO);
159 list_for_each(list, &card->devices) { 162 list_for_each(list, &card->devices) {
160 dev = snd_device(list); 163 dev = snd_device(list);
161 if (dev->device_data != device_data) 164 if (dev->device_data != device_data)