aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/caiaq/device.c
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2013-03-03 14:46:21 -0500
committerTakashi Iwai <tiwai@suse.de>2013-03-04 03:57:17 -0500
commit1c8470ce311c6b2b49a71a02961c360d04ed28b2 (patch)
tree34aca4afee14e143a0e3f6150888f3af4655fe22 /sound/usb/caiaq/device.c
parent6dbe51c251a327e012439c4772097a13df43c5b8 (diff)
ALSA: snd-usb-caiaq: rename 'dev' to 'cdev'
This is needed in order to make the device namespace cleaner, and will help when moving this driver over to dev_*() logging. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/caiaq/device.c')
-rw-r--r--sound/usb/caiaq/device.c210
1 files changed, 105 insertions, 105 deletions
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
index e4d6dbb0342d..45c3853b2a65 100644
--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -158,67 +158,67 @@ static struct usb_device_id snd_usb_id_table[] = {
158static void usb_ep1_command_reply_dispatch (struct urb* urb) 158static void usb_ep1_command_reply_dispatch (struct urb* urb)
159{ 159{
160 int ret; 160 int ret;
161 struct snd_usb_caiaqdev *dev = urb->context; 161 struct snd_usb_caiaqdev *cdev = urb->context;
162 unsigned char *buf = urb->transfer_buffer; 162 unsigned char *buf = urb->transfer_buffer;
163 163
164 if (urb->status || !dev) { 164 if (urb->status || !cdev) {
165 log("received EP1 urb->status = %i\n", urb->status); 165 log("received EP1 urb->status = %i\n", urb->status);
166 return; 166 return;
167 } 167 }
168 168
169 switch(buf[0]) { 169 switch(buf[0]) {
170 case EP1_CMD_GET_DEVICE_INFO: 170 case EP1_CMD_GET_DEVICE_INFO:
171 memcpy(&dev->spec, buf+1, sizeof(struct caiaq_device_spec)); 171 memcpy(&cdev->spec, buf+1, sizeof(struct caiaq_device_spec));
172 dev->spec.fw_version = le16_to_cpu(dev->spec.fw_version); 172 cdev->spec.fw_version = le16_to_cpu(cdev->spec.fw_version);
173 debug("device spec (firmware %d): audio: %d in, %d out, " 173 debug("device spec (firmware %d): audio: %d in, %d out, "
174 "MIDI: %d in, %d out, data alignment %d\n", 174 "MIDI: %d in, %d out, data alignment %d\n",
175 dev->spec.fw_version, 175 cdev->spec.fw_version,
176 dev->spec.num_analog_audio_in, 176 cdev->spec.num_analog_audio_in,
177 dev->spec.num_analog_audio_out, 177 cdev->spec.num_analog_audio_out,
178 dev->spec.num_midi_in, 178 cdev->spec.num_midi_in,
179 dev->spec.num_midi_out, 179 cdev->spec.num_midi_out,
180 dev->spec.data_alignment); 180 cdev->spec.data_alignment);
181 181
182 dev->spec_received++; 182 cdev->spec_received++;
183 wake_up(&dev->ep1_wait_queue); 183 wake_up(&cdev->ep1_wait_queue);
184 break; 184 break;
185 case EP1_CMD_AUDIO_PARAMS: 185 case EP1_CMD_AUDIO_PARAMS:
186 dev->audio_parm_answer = buf[1]; 186 cdev->audio_parm_answer = buf[1];
187 wake_up(&dev->ep1_wait_queue); 187 wake_up(&cdev->ep1_wait_queue);
188 break; 188 break;
189 case EP1_CMD_MIDI_READ: 189 case EP1_CMD_MIDI_READ:
190 snd_usb_caiaq_midi_handle_input(dev, buf[1], buf + 3, buf[2]); 190 snd_usb_caiaq_midi_handle_input(cdev, buf[1], buf + 3, buf[2]);
191 break; 191 break;
192 case EP1_CMD_READ_IO: 192 case EP1_CMD_READ_IO:
193 if (dev->chip.usb_id == 193 if (cdev->chip.usb_id ==
194 USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ)) { 194 USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ)) {
195 if (urb->actual_length > sizeof(dev->control_state)) 195 if (urb->actual_length > sizeof(cdev->control_state))
196 urb->actual_length = sizeof(dev->control_state); 196 urb->actual_length = sizeof(cdev->control_state);
197 memcpy(dev->control_state, buf + 1, urb->actual_length); 197 memcpy(cdev->control_state, buf + 1, urb->actual_length);
198 wake_up(&dev->ep1_wait_queue); 198 wake_up(&cdev->ep1_wait_queue);
199 break; 199 break;
200 } 200 }
201#ifdef CONFIG_SND_USB_CAIAQ_INPUT 201#ifdef CONFIG_SND_USB_CAIAQ_INPUT
202 case EP1_CMD_READ_ERP: 202 case EP1_CMD_READ_ERP:
203 case EP1_CMD_READ_ANALOG: 203 case EP1_CMD_READ_ANALOG:
204 snd_usb_caiaq_input_dispatch(dev, buf, urb->actual_length); 204 snd_usb_caiaq_input_dispatch(cdev, buf, urb->actual_length);
205#endif 205#endif
206 break; 206 break;
207 } 207 }
208 208
209 dev->ep1_in_urb.actual_length = 0; 209 cdev->ep1_in_urb.actual_length = 0;
210 ret = usb_submit_urb(&dev->ep1_in_urb, GFP_ATOMIC); 210 ret = usb_submit_urb(&cdev->ep1_in_urb, GFP_ATOMIC);
211 if (ret < 0) 211 if (ret < 0)
212 log("unable to submit urb. OOM!?\n"); 212 log("unable to submit urb. OOM!?\n");
213} 213}
214 214
215int snd_usb_caiaq_send_command(struct snd_usb_caiaqdev *dev, 215int snd_usb_caiaq_send_command(struct snd_usb_caiaqdev *cdev,
216 unsigned char command, 216 unsigned char command,
217 const unsigned char *buffer, 217 const unsigned char *buffer,
218 int len) 218 int len)
219{ 219{
220 int actual_len; 220 int actual_len;
221 struct usb_device *usb_dev = dev->chip.dev; 221 struct usb_device *usb_dev = cdev->chip.dev;
222 222
223 if (!usb_dev) 223 if (!usb_dev)
224 return -EIO; 224 return -EIO;
@@ -227,14 +227,14 @@ int snd_usb_caiaq_send_command(struct snd_usb_caiaqdev *dev,
227 len = EP1_BUFSIZE - 1; 227 len = EP1_BUFSIZE - 1;
228 228
229 if (buffer && len > 0) 229 if (buffer && len > 0)
230 memcpy(dev->ep1_out_buf+1, buffer, len); 230 memcpy(cdev->ep1_out_buf+1, buffer, len);
231 231
232 dev->ep1_out_buf[0] = command; 232 cdev->ep1_out_buf[0] = command;
233 return usb_bulk_msg(usb_dev, usb_sndbulkpipe(usb_dev, 1), 233 return usb_bulk_msg(usb_dev, usb_sndbulkpipe(usb_dev, 1),
234 dev->ep1_out_buf, len+1, &actual_len, 200); 234 cdev->ep1_out_buf, len+1, &actual_len, 200);
235} 235}
236 236
237int snd_usb_caiaq_set_audio_params (struct snd_usb_caiaqdev *dev, 237int snd_usb_caiaq_set_audio_params (struct snd_usb_caiaqdev *cdev,
238 int rate, int depth, int bpp) 238 int rate, int depth, int bpp)
239{ 239{
240 int ret; 240 int ret;
@@ -262,46 +262,46 @@ int snd_usb_caiaq_set_audio_params (struct snd_usb_caiaqdev *dev,
262 debug("setting audio params: %d Hz, %d bits, %d bpp\n", 262 debug("setting audio params: %d Hz, %d bits, %d bpp\n",
263 rate, depth, bpp); 263 rate, depth, bpp);
264 264
265 dev->audio_parm_answer = -1; 265 cdev->audio_parm_answer = -1;
266 ret = snd_usb_caiaq_send_command(dev, EP1_CMD_AUDIO_PARAMS, 266 ret = snd_usb_caiaq_send_command(cdev, EP1_CMD_AUDIO_PARAMS,
267 tmp, sizeof(tmp)); 267 tmp, sizeof(tmp));
268 268
269 if (ret) 269 if (ret)
270 return ret; 270 return ret;
271 271
272 if (!wait_event_timeout(dev->ep1_wait_queue, 272 if (!wait_event_timeout(cdev->ep1_wait_queue,
273 dev->audio_parm_answer >= 0, HZ)) 273 cdev->audio_parm_answer >= 0, HZ))
274 return -EPIPE; 274 return -EPIPE;
275 275
276 if (dev->audio_parm_answer != 1) 276 if (cdev->audio_parm_answer != 1)
277 debug("unable to set the device's audio params\n"); 277 debug("unable to set the device's audio params\n");
278 else 278 else
279 dev->bpp = bpp; 279 cdev->bpp = bpp;
280 280
281 return dev->audio_parm_answer == 1 ? 0 : -EINVAL; 281 return cdev->audio_parm_answer == 1 ? 0 : -EINVAL;
282} 282}
283 283
284int snd_usb_caiaq_set_auto_msg(struct snd_usb_caiaqdev *dev, 284int snd_usb_caiaq_set_auto_msg(struct snd_usb_caiaqdev *cdev,
285 int digital, int analog, int erp) 285 int digital, int analog, int erp)
286{ 286{
287 char tmp[3] = { digital, analog, erp }; 287 char tmp[3] = { digital, analog, erp };
288 return snd_usb_caiaq_send_command(dev, EP1_CMD_AUTO_MSG, 288 return snd_usb_caiaq_send_command(cdev, EP1_CMD_AUTO_MSG,
289 tmp, sizeof(tmp)); 289 tmp, sizeof(tmp));
290} 290}
291 291
292static void setup_card(struct snd_usb_caiaqdev *dev) 292static void setup_card(struct snd_usb_caiaqdev *cdev)
293{ 293{
294 int ret; 294 int ret;
295 char val[4]; 295 char val[4];
296 296
297 /* device-specific startup specials */ 297 /* device-specific startup specials */
298 switch (dev->chip.usb_id) { 298 switch (cdev->chip.usb_id) {
299 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL2): 299 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL2):
300 /* RigKontrol2 - display centered dash ('-') */ 300 /* RigKontrol2 - display centered dash ('-') */
301 val[0] = 0x00; 301 val[0] = 0x00;
302 val[1] = 0x00; 302 val[1] = 0x00;
303 val[2] = 0x01; 303 val[2] = 0x01;
304 snd_usb_caiaq_send_command(dev, EP1_CMD_WRITE_IO, val, 3); 304 snd_usb_caiaq_send_command(cdev, EP1_CMD_WRITE_IO, val, 3);
305 break; 305 break;
306 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL3): 306 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL3):
307 /* RigKontrol2 - display two centered dashes ('--') */ 307 /* RigKontrol2 - display two centered dashes ('--') */
@@ -309,67 +309,67 @@ static void setup_card(struct snd_usb_caiaqdev *dev)
309 val[1] = 0x40; 309 val[1] = 0x40;
310 val[2] = 0x40; 310 val[2] = 0x40;
311 val[3] = 0x00; 311 val[3] = 0x00;
312 snd_usb_caiaq_send_command(dev, EP1_CMD_WRITE_IO, val, 4); 312 snd_usb_caiaq_send_command(cdev, EP1_CMD_WRITE_IO, val, 4);
313 break; 313 break;
314 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1): 314 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1):
315 /* Audio Kontrol 1 - make USB-LED stop blinking */ 315 /* Audio Kontrol 1 - make USB-LED stop blinking */
316 val[0] = 0x00; 316 val[0] = 0x00;
317 snd_usb_caiaq_send_command(dev, EP1_CMD_WRITE_IO, val, 1); 317 snd_usb_caiaq_send_command(cdev, EP1_CMD_WRITE_IO, val, 1);
318 break; 318 break;
319 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ): 319 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ):
320 /* Audio 8 DJ - trigger read of current settings */ 320 /* Audio 8 DJ - trigger read of current settings */
321 dev->control_state[0] = 0xff; 321 cdev->control_state[0] = 0xff;
322 snd_usb_caiaq_set_auto_msg(dev, 1, 0, 0); 322 snd_usb_caiaq_set_auto_msg(cdev, 1, 0, 0);
323 snd_usb_caiaq_send_command(dev, EP1_CMD_READ_IO, NULL, 0); 323 snd_usb_caiaq_send_command(cdev, EP1_CMD_READ_IO, NULL, 0);
324 324
325 if (!wait_event_timeout(dev->ep1_wait_queue, 325 if (!wait_event_timeout(cdev->ep1_wait_queue,
326 dev->control_state[0] != 0xff, HZ)) 326 cdev->control_state[0] != 0xff, HZ))
327 return; 327 return;
328 328
329 /* fix up some defaults */ 329 /* fix up some defaults */
330 if ((dev->control_state[1] != 2) || 330 if ((cdev->control_state[1] != 2) ||
331 (dev->control_state[2] != 3) || 331 (cdev->control_state[2] != 3) ||
332 (dev->control_state[4] != 2)) { 332 (cdev->control_state[4] != 2)) {
333 dev->control_state[1] = 2; 333 cdev->control_state[1] = 2;
334 dev->control_state[2] = 3; 334 cdev->control_state[2] = 3;
335 dev->control_state[4] = 2; 335 cdev->control_state[4] = 2;
336 snd_usb_caiaq_send_command(dev, 336 snd_usb_caiaq_send_command(cdev,
337 EP1_CMD_WRITE_IO, dev->control_state, 6); 337 EP1_CMD_WRITE_IO, cdev->control_state, 6);
338 } 338 }
339 339
340 break; 340 break;
341 } 341 }
342 342
343 if (dev->spec.num_analog_audio_out + 343 if (cdev->spec.num_analog_audio_out +
344 dev->spec.num_analog_audio_in + 344 cdev->spec.num_analog_audio_in +
345 dev->spec.num_digital_audio_out + 345 cdev->spec.num_digital_audio_out +
346 dev->spec.num_digital_audio_in > 0) { 346 cdev->spec.num_digital_audio_in > 0) {
347 ret = snd_usb_caiaq_audio_init(dev); 347 ret = snd_usb_caiaq_audio_init(cdev);
348 if (ret < 0) 348 if (ret < 0)
349 log("Unable to set up audio system (ret=%d)\n", ret); 349 log("Unable to set up audio system (ret=%d)\n", ret);
350 } 350 }
351 351
352 if (dev->spec.num_midi_in + 352 if (cdev->spec.num_midi_in +
353 dev->spec.num_midi_out > 0) { 353 cdev->spec.num_midi_out > 0) {
354 ret = snd_usb_caiaq_midi_init(dev); 354 ret = snd_usb_caiaq_midi_init(cdev);
355 if (ret < 0) 355 if (ret < 0)
356 log("Unable to set up MIDI system (ret=%d)\n", ret); 356 log("Unable to set up MIDI system (ret=%d)\n", ret);
357 } 357 }
358 358
359#ifdef CONFIG_SND_USB_CAIAQ_INPUT 359#ifdef CONFIG_SND_USB_CAIAQ_INPUT
360 ret = snd_usb_caiaq_input_init(dev); 360 ret = snd_usb_caiaq_input_init(cdev);
361 if (ret < 0) 361 if (ret < 0)
362 log("Unable to set up input system (ret=%d)\n", ret); 362 log("Unable to set up input system (ret=%d)\n", ret);
363#endif 363#endif
364 364
365 /* finally, register the card and all its sub-instances */ 365 /* finally, register the card and all its sub-instances */
366 ret = snd_card_register(dev->chip.card); 366 ret = snd_card_register(cdev->chip.card);
367 if (ret < 0) { 367 if (ret < 0) {
368 log("snd_card_register() returned %d\n", ret); 368 log("snd_card_register() returned %d\n", ret);
369 snd_card_free(dev->chip.card); 369 snd_card_free(cdev->chip.card);
370 } 370 }
371 371
372 ret = snd_usb_caiaq_control_init(dev); 372 ret = snd_usb_caiaq_control_init(cdev);
373 if (ret < 0) 373 if (ret < 0)
374 log("Unable to set up control system (ret=%d)\n", ret); 374 log("Unable to set up control system (ret=%d)\n", ret);
375} 375}
@@ -381,7 +381,7 @@ static int create_card(struct usb_device *usb_dev,
381 int devnum; 381 int devnum;
382 int err; 382 int err;
383 struct snd_card *card; 383 struct snd_card *card;
384 struct snd_usb_caiaqdev *dev; 384 struct snd_usb_caiaqdev *cdev;
385 385
386 for (devnum = 0; devnum < SNDRV_CARDS; devnum++) 386 for (devnum = 0; devnum < SNDRV_CARDS; devnum++)
387 if (enable[devnum] && !snd_card_used[devnum]) 387 if (enable[devnum] && !snd_card_used[devnum])
@@ -395,23 +395,23 @@ static int create_card(struct usb_device *usb_dev,
395 if (err < 0) 395 if (err < 0)
396 return err; 396 return err;
397 397
398 dev = caiaqdev(card); 398 cdev = caiaqdev(card);
399 dev->chip.dev = usb_dev; 399 cdev->chip.dev = usb_dev;
400 dev->chip.card = card; 400 cdev->chip.card = card;
401 dev->chip.usb_id = USB_ID(le16_to_cpu(usb_dev->descriptor.idVendor), 401 cdev->chip.usb_id = USB_ID(le16_to_cpu(usb_dev->descriptor.idVendor),
402 le16_to_cpu(usb_dev->descriptor.idProduct)); 402 le16_to_cpu(usb_dev->descriptor.idProduct));
403 spin_lock_init(&dev->spinlock); 403 spin_lock_init(&cdev->spinlock);
404 snd_card_set_dev(card, &intf->dev); 404 snd_card_set_dev(card, &intf->dev);
405 405
406 *cardp = card; 406 *cardp = card;
407 return 0; 407 return 0;
408} 408}
409 409
410static int init_card(struct snd_usb_caiaqdev *dev) 410static int init_card(struct snd_usb_caiaqdev *cdev)
411{ 411{
412 char *c, usbpath[32]; 412 char *c, usbpath[32];
413 struct usb_device *usb_dev = dev->chip.dev; 413 struct usb_device *usb_dev = cdev->chip.dev;
414 struct snd_card *card = dev->chip.card; 414 struct snd_card *card = cdev->chip.card;
415 int err, len; 415 int err, len;
416 416
417 if (usb_set_interface(usb_dev, 0, 1) != 0) { 417 if (usb_set_interface(usb_dev, 0, 1) != 0) {
@@ -419,41 +419,41 @@ static int init_card(struct snd_usb_caiaqdev *dev)
419 return -EIO; 419 return -EIO;
420 } 420 }
421 421
422 usb_init_urb(&dev->ep1_in_urb); 422 usb_init_urb(&cdev->ep1_in_urb);
423 usb_init_urb(&dev->midi_out_urb); 423 usb_init_urb(&cdev->midi_out_urb);
424 424
425 usb_fill_bulk_urb(&dev->ep1_in_urb, usb_dev, 425 usb_fill_bulk_urb(&cdev->ep1_in_urb, usb_dev,
426 usb_rcvbulkpipe(usb_dev, 0x1), 426 usb_rcvbulkpipe(usb_dev, 0x1),
427 dev->ep1_in_buf, EP1_BUFSIZE, 427 cdev->ep1_in_buf, EP1_BUFSIZE,
428 usb_ep1_command_reply_dispatch, dev); 428 usb_ep1_command_reply_dispatch, cdev);
429 429
430 usb_fill_bulk_urb(&dev->midi_out_urb, usb_dev, 430 usb_fill_bulk_urb(&cdev->midi_out_urb, usb_dev,
431 usb_sndbulkpipe(usb_dev, 0x1), 431 usb_sndbulkpipe(usb_dev, 0x1),
432 dev->midi_out_buf, EP1_BUFSIZE, 432 cdev->midi_out_buf, EP1_BUFSIZE,
433 snd_usb_caiaq_midi_output_done, dev); 433 snd_usb_caiaq_midi_output_done, cdev);
434 434
435 init_waitqueue_head(&dev->ep1_wait_queue); 435 init_waitqueue_head(&cdev->ep1_wait_queue);
436 init_waitqueue_head(&dev->prepare_wait_queue); 436 init_waitqueue_head(&cdev->prepare_wait_queue);
437 437
438 if (usb_submit_urb(&dev->ep1_in_urb, GFP_KERNEL) != 0) 438 if (usb_submit_urb(&cdev->ep1_in_urb, GFP_KERNEL) != 0)
439 return -EIO; 439 return -EIO;
440 440
441 err = snd_usb_caiaq_send_command(dev, EP1_CMD_GET_DEVICE_INFO, NULL, 0); 441 err = snd_usb_caiaq_send_command(cdev, EP1_CMD_GET_DEVICE_INFO, NULL, 0);
442 if (err) 442 if (err)
443 return err; 443 return err;
444 444
445 if (!wait_event_timeout(dev->ep1_wait_queue, dev->spec_received, HZ)) 445 if (!wait_event_timeout(cdev->ep1_wait_queue, cdev->spec_received, HZ))
446 return -ENODEV; 446 return -ENODEV;
447 447
448 usb_string(usb_dev, usb_dev->descriptor.iManufacturer, 448 usb_string(usb_dev, usb_dev->descriptor.iManufacturer,
449 dev->vendor_name, CAIAQ_USB_STR_LEN); 449 cdev->vendor_name, CAIAQ_USB_STR_LEN);
450 450
451 usb_string(usb_dev, usb_dev->descriptor.iProduct, 451 usb_string(usb_dev, usb_dev->descriptor.iProduct,
452 dev->product_name, CAIAQ_USB_STR_LEN); 452 cdev->product_name, CAIAQ_USB_STR_LEN);
453 453
454 strlcpy(card->driver, MODNAME, sizeof(card->driver)); 454 strlcpy(card->driver, MODNAME, sizeof(card->driver));
455 strlcpy(card->shortname, dev->product_name, sizeof(card->shortname)); 455 strlcpy(card->shortname, cdev->product_name, sizeof(card->shortname));
456 strlcpy(card->mixername, dev->product_name, sizeof(card->mixername)); 456 strlcpy(card->mixername, cdev->product_name, sizeof(card->mixername));
457 457
458 /* if the id was not passed as module option, fill it with a shortened 458 /* if the id was not passed as module option, fill it with a shortened
459 * version of the product string which does not contain any 459 * version of the product string which does not contain any
@@ -475,9 +475,9 @@ static int init_card(struct snd_usb_caiaqdev *dev)
475 usb_make_path(usb_dev, usbpath, sizeof(usbpath)); 475 usb_make_path(usb_dev, usbpath, sizeof(usbpath));
476 snprintf(card->longname, sizeof(card->longname), 476 snprintf(card->longname, sizeof(card->longname),
477 "%s %s (%s)", 477 "%s %s (%s)",
478 dev->vendor_name, dev->product_name, usbpath); 478 cdev->vendor_name, cdev->product_name, usbpath);
479 479
480 setup_card(dev); 480 setup_card(cdev);
481 return 0; 481 return 0;
482} 482}
483 483
@@ -486,9 +486,9 @@ static int snd_probe(struct usb_interface *intf,
486{ 486{
487 int ret; 487 int ret;
488 struct snd_card *card = NULL; 488 struct snd_card *card = NULL;
489 struct usb_device *device = interface_to_usbdev(intf); 489 struct usb_device *usb_dev = interface_to_usbdev(intf);
490 490
491 ret = create_card(device, intf, &card); 491 ret = create_card(usb_dev, intf, &card);
492 492
493 if (ret < 0) 493 if (ret < 0)
494 return ret; 494 return ret;
@@ -506,7 +506,7 @@ static int snd_probe(struct usb_interface *intf,
506 506
507static void snd_disconnect(struct usb_interface *intf) 507static void snd_disconnect(struct usb_interface *intf)
508{ 508{
509 struct snd_usb_caiaqdev *dev; 509 struct snd_usb_caiaqdev *cdev;
510 struct snd_card *card = usb_get_intfdata(intf); 510 struct snd_card *card = usb_get_intfdata(intf);
511 511
512 debug("%s(%p)\n", __func__, intf); 512 debug("%s(%p)\n", __func__, intf);
@@ -514,16 +514,16 @@ static void snd_disconnect(struct usb_interface *intf)
514 if (!card) 514 if (!card)
515 return; 515 return;
516 516
517 dev = caiaqdev(card); 517 cdev = caiaqdev(card);
518 snd_card_disconnect(card); 518 snd_card_disconnect(card);
519 519
520#ifdef CONFIG_SND_USB_CAIAQ_INPUT 520#ifdef CONFIG_SND_USB_CAIAQ_INPUT
521 snd_usb_caiaq_input_free(dev); 521 snd_usb_caiaq_input_free(cdev);
522#endif 522#endif
523 snd_usb_caiaq_audio_free(dev); 523 snd_usb_caiaq_audio_free(cdev);
524 524
525 usb_kill_urb(&dev->ep1_in_urb); 525 usb_kill_urb(&cdev->ep1_in_urb);
526 usb_kill_urb(&dev->midi_out_urb); 526 usb_kill_urb(&cdev->midi_out_urb);
527 527
528 snd_card_free(card); 528 snd_card_free(card);
529 usb_reset_device(interface_to_usbdev(intf)); 529 usb_reset_device(interface_to_usbdev(intf));