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.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/sound/core/device.c b/sound/core/device.c
index 1f509f56e60c..afa8cc7fb05e 100644
--- a/sound/core/device.c
+++ b/sound/core/device.c
@@ -41,10 +41,10 @@
41 * 41 *
42 * Returns zero if successful, or a negative error code on failure. 42 * Returns zero if successful, or a negative error code on failure.
43 */ 43 */
44int snd_device_new(snd_card_t *card, snd_device_type_t type, 44int snd_device_new(struct snd_card *card, snd_device_type_t type,
45 void *device_data, snd_device_ops_t *ops) 45 void *device_data, struct snd_device_ops *ops)
46{ 46{
47 snd_device_t *dev; 47 struct snd_device *dev;
48 48
49 snd_assert(card != NULL, return -ENXIO); 49 snd_assert(card != NULL, return -ENXIO);
50 snd_assert(device_data != NULL, return -ENXIO); 50 snd_assert(device_data != NULL, return -ENXIO);
@@ -73,10 +73,10 @@ int snd_device_new(snd_card_t *card, snd_device_type_t type,
73 * Returns zero if successful, or a negative error code on failure or if the 73 * Returns zero if successful, or a negative error code on failure or if the
74 * device not found. 74 * device not found.
75 */ 75 */
76int snd_device_free(snd_card_t *card, void *device_data) 76int snd_device_free(struct snd_card *card, void *device_data)
77{ 77{
78 struct list_head *list; 78 struct list_head *list;
79 snd_device_t *dev; 79 struct snd_device *dev;
80 80
81 snd_assert(card != NULL, return -ENXIO); 81 snd_assert(card != NULL, return -ENXIO);
82 snd_assert(device_data != NULL, return -ENXIO); 82 snd_assert(device_data != NULL, return -ENXIO);
@@ -86,7 +86,8 @@ int snd_device_free(snd_card_t *card, void *device_data)
86 continue; 86 continue;
87 /* unlink */ 87 /* unlink */
88 list_del(&dev->list); 88 list_del(&dev->list);
89 if ((dev->state == SNDRV_DEV_REGISTERED || dev->state == SNDRV_DEV_DISCONNECTED) && 89 if ((dev->state == SNDRV_DEV_REGISTERED ||
90 dev->state == SNDRV_DEV_DISCONNECTED) &&
90 dev->ops->dev_unregister) { 91 dev->ops->dev_unregister) {
91 if (dev->ops->dev_unregister(dev)) 92 if (dev->ops->dev_unregister(dev))
92 snd_printk(KERN_ERR "device unregister failure\n"); 93 snd_printk(KERN_ERR "device unregister failure\n");
@@ -99,7 +100,8 @@ int snd_device_free(snd_card_t *card, void *device_data)
99 kfree(dev); 100 kfree(dev);
100 return 0; 101 return 0;
101 } 102 }
102 snd_printd("device free %p (from %p), not found\n", device_data, __builtin_return_address(0)); 103 snd_printd("device free %p (from %p), not found\n", device_data,
104 __builtin_return_address(0));
103 return -ENXIO; 105 return -ENXIO;
104} 106}
105 107
@@ -116,10 +118,10 @@ int snd_device_free(snd_card_t *card, void *device_data)
116 * Returns zero if successful, or a negative error code on failure or if the 118 * Returns zero if successful, or a negative error code on failure or if the
117 * device not found. 119 * device not found.
118 */ 120 */
119int snd_device_disconnect(snd_card_t *card, void *device_data) 121int snd_device_disconnect(struct snd_card *card, void *device_data)
120{ 122{
121 struct list_head *list; 123 struct list_head *list;
122 snd_device_t *dev; 124 struct snd_device *dev;
123 125
124 snd_assert(card != NULL, return -ENXIO); 126 snd_assert(card != NULL, return -ENXIO);
125 snd_assert(device_data != NULL, return -ENXIO); 127 snd_assert(device_data != NULL, return -ENXIO);
@@ -127,14 +129,16 @@ int snd_device_disconnect(snd_card_t *card, void *device_data)
127 dev = snd_device(list); 129 dev = snd_device(list);
128 if (dev->device_data != device_data) 130 if (dev->device_data != device_data)
129 continue; 131 continue;
130 if (dev->state == SNDRV_DEV_REGISTERED && dev->ops->dev_disconnect) { 132 if (dev->state == SNDRV_DEV_REGISTERED &&
133 dev->ops->dev_disconnect) {
131 if (dev->ops->dev_disconnect(dev)) 134 if (dev->ops->dev_disconnect(dev))
132 snd_printk(KERN_ERR "device disconnect failure\n"); 135 snd_printk(KERN_ERR "device disconnect failure\n");
133 dev->state = SNDRV_DEV_DISCONNECTED; 136 dev->state = SNDRV_DEV_DISCONNECTED;
134 } 137 }
135 return 0; 138 return 0;
136 } 139 }
137 snd_printd("device disconnect %p (from %p), not found\n", device_data, __builtin_return_address(0)); 140 snd_printd("device disconnect %p (from %p), not found\n", device_data,
141 __builtin_return_address(0));
138 return -ENXIO; 142 return -ENXIO;
139} 143}
140 144
@@ -151,10 +155,10 @@ int snd_device_disconnect(snd_card_t *card, void *device_data)
151 * Returns zero if successful, or a negative error code on failure or if the 155 * Returns zero if successful, or a negative error code on failure or if the
152 * device not found. 156 * device not found.
153 */ 157 */
154int snd_device_register(snd_card_t *card, void *device_data) 158int snd_device_register(struct snd_card *card, void *device_data)
155{ 159{
156 struct list_head *list; 160 struct list_head *list;
157 snd_device_t *dev; 161 struct snd_device *dev;
158 int err; 162 int err;
159 163
160 snd_assert(card != NULL, return -ENXIO); 164 snd_assert(card != NULL, return -ENXIO);
@@ -179,10 +183,10 @@ int snd_device_register(snd_card_t *card, void *device_data)
179 * register all the devices on the card. 183 * register all the devices on the card.
180 * called from init.c 184 * called from init.c
181 */ 185 */
182int snd_device_register_all(snd_card_t *card) 186int snd_device_register_all(struct snd_card *card)
183{ 187{
184 struct list_head *list; 188 struct list_head *list;
185 snd_device_t *dev; 189 struct snd_device *dev;
186 int err; 190 int err;
187 191
188 snd_assert(card != NULL, return -ENXIO); 192 snd_assert(card != NULL, return -ENXIO);
@@ -201,9 +205,9 @@ int snd_device_register_all(snd_card_t *card)
201 * disconnect all the devices on the card. 205 * disconnect all the devices on the card.
202 * called from init.c 206 * called from init.c
203 */ 207 */
204int snd_device_disconnect_all(snd_card_t *card) 208int snd_device_disconnect_all(struct snd_card *card)
205{ 209{
206 snd_device_t *dev; 210 struct snd_device *dev;
207 struct list_head *list; 211 struct list_head *list;
208 int err = 0; 212 int err = 0;
209 213
@@ -220,9 +224,9 @@ int snd_device_disconnect_all(snd_card_t *card)
220 * release all the devices on the card. 224 * release all the devices on the card.
221 * called from init.c 225 * called from init.c
222 */ 226 */
223int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd) 227int snd_device_free_all(struct snd_card *card, snd_device_cmd_t cmd)
224{ 228{
225 snd_device_t *dev; 229 struct snd_device *dev;
226 struct list_head *list; 230 struct list_head *list;
227 int err; 231 int err;
228 unsigned int range_low, range_high; 232 unsigned int range_low, range_high;