diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2009-11-16 06:26:30 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-11-24 04:20:09 -0500 |
commit | a014bbadb53121e243cac254593e79e3ca89742d (patch) | |
tree | 1bfd7f4106b9041839ff7944dfcf12d79f1397fd /sound/usb/usx2y/usbusx2y.c | |
parent | d82af9f9aab69e82b86450272588c861364f8879 (diff) |
sound: usxxx: cleanup chip field
The chip field is no longer needed. Move those of its fields that are
actually used to the device structure itself.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/usx2y/usbusx2y.c')
-rw-r--r-- | sound/usb/usx2y/usbusx2y.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c index 181337090e48..c42350eed2eb 100644 --- a/sound/usb/usx2y/usbusx2y.c +++ b/sound/usb/usx2y/usbusx2y.c | |||
@@ -239,8 +239,8 @@ static void i_usX2Y_In04Int(struct urb *urb) | |||
239 | for (j = 0; j < URBS_AsyncSeq && !err; ++j) | 239 | for (j = 0; j < URBS_AsyncSeq && !err; ++j) |
240 | if (0 == usX2Y->AS04.urb[j]->status) { | 240 | if (0 == usX2Y->AS04.urb[j]->status) { |
241 | struct us428_p4out *p4out = us428ctls->p4out + send; // FIXME if more than 1 p4out is new, 1 gets lost. | 241 | struct us428_p4out *p4out = us428ctls->p4out + send; // FIXME if more than 1 p4out is new, 1 gets lost. |
242 | usb_fill_bulk_urb(usX2Y->AS04.urb[j], usX2Y->chip.dev, | 242 | usb_fill_bulk_urb(usX2Y->AS04.urb[j], usX2Y->dev, |
243 | usb_sndbulkpipe(usX2Y->chip.dev, 0x04), &p4out->val.vol, | 243 | usb_sndbulkpipe(usX2Y->dev, 0x04), &p4out->val.vol, |
244 | p4out->type == eLT_Light ? sizeof(struct us428_lights) : 5, | 244 | p4out->type == eLT_Light ? sizeof(struct us428_lights) : 5, |
245 | i_usX2Y_Out04Int, usX2Y); | 245 | i_usX2Y_Out04Int, usX2Y); |
246 | err = usb_submit_urb(usX2Y->AS04.urb[j], GFP_ATOMIC); | 246 | err = usb_submit_urb(usX2Y->AS04.urb[j], GFP_ATOMIC); |
@@ -253,7 +253,7 @@ static void i_usX2Y_In04Int(struct urb *urb) | |||
253 | if (err) | 253 | if (err) |
254 | snd_printk(KERN_ERR "In04Int() usb_submit_urb err=%i\n", err); | 254 | snd_printk(KERN_ERR "In04Int() usb_submit_urb err=%i\n", err); |
255 | 255 | ||
256 | urb->dev = usX2Y->chip.dev; | 256 | urb->dev = usX2Y->dev; |
257 | usb_submit_urb(urb, GFP_ATOMIC); | 257 | usb_submit_urb(urb, GFP_ATOMIC); |
258 | } | 258 | } |
259 | 259 | ||
@@ -273,8 +273,8 @@ int usX2Y_AsyncSeq04_init(struct usX2Ydev *usX2Y) | |||
273 | err = -ENOMEM; | 273 | err = -ENOMEM; |
274 | break; | 274 | break; |
275 | } | 275 | } |
276 | usb_fill_bulk_urb( usX2Y->AS04.urb[i], usX2Y->chip.dev, | 276 | usb_fill_bulk_urb( usX2Y->AS04.urb[i], usX2Y->dev, |
277 | usb_sndbulkpipe(usX2Y->chip.dev, 0x04), | 277 | usb_sndbulkpipe(usX2Y->dev, 0x04), |
278 | usX2Y->AS04.buffer + URB_DataLen_AsyncSeq*i, 0, | 278 | usX2Y->AS04.buffer + URB_DataLen_AsyncSeq*i, 0, |
279 | i_usX2Y_Out04Int, usX2Y | 279 | i_usX2Y_Out04Int, usX2Y |
280 | ); | 280 | ); |
@@ -293,7 +293,7 @@ int usX2Y_In04_init(struct usX2Ydev *usX2Y) | |||
293 | } | 293 | } |
294 | 294 | ||
295 | init_waitqueue_head(&usX2Y->In04WaitQueue); | 295 | init_waitqueue_head(&usX2Y->In04WaitQueue); |
296 | usb_fill_int_urb(usX2Y->In04urb, usX2Y->chip.dev, usb_rcvintpipe(usX2Y->chip.dev, 0x4), | 296 | usb_fill_int_urb(usX2Y->In04urb, usX2Y->dev, usb_rcvintpipe(usX2Y->dev, 0x4), |
297 | usX2Y->In04Buf, 21, | 297 | usX2Y->In04Buf, 21, |
298 | i_usX2Y_In04Int, usX2Y, | 298 | i_usX2Y_In04Int, usX2Y, |
299 | 10); | 299 | 10); |
@@ -348,10 +348,9 @@ static int usX2Y_create_card(struct usb_device *device, struct snd_card **cardp) | |||
348 | sizeof(struct usX2Ydev), &card); | 348 | sizeof(struct usX2Ydev), &card); |
349 | if (err < 0) | 349 | if (err < 0) |
350 | return err; | 350 | return err; |
351 | snd_usX2Y_card_used[usX2Y(card)->chip.index = dev] = 1; | 351 | snd_usX2Y_card_used[usX2Y(card)->card_index = dev] = 1; |
352 | card->private_free = snd_usX2Y_card_private_free; | 352 | card->private_free = snd_usX2Y_card_private_free; |
353 | usX2Y(card)->chip.dev = device; | 353 | usX2Y(card)->dev = device; |
354 | usX2Y(card)->chip.card = card; | ||
355 | init_waitqueue_head(&usX2Y(card)->prepare_wait_queue); | 354 | init_waitqueue_head(&usX2Y(card)->prepare_wait_queue); |
356 | mutex_init(&usX2Y(card)->prepare_mutex); | 355 | mutex_init(&usX2Y(card)->prepare_mutex); |
357 | INIT_LIST_HEAD(&usX2Y(card)->midi_list); | 356 | INIT_LIST_HEAD(&usX2Y(card)->midi_list); |
@@ -362,7 +361,7 @@ static int usX2Y_create_card(struct usb_device *device, struct snd_card **cardp) | |||
362 | le16_to_cpu(device->descriptor.idVendor), | 361 | le16_to_cpu(device->descriptor.idVendor), |
363 | le16_to_cpu(device->descriptor.idProduct), | 362 | le16_to_cpu(device->descriptor.idProduct), |
364 | 0,//us428(card)->usbmidi.ifnum, | 363 | 0,//us428(card)->usbmidi.ifnum, |
365 | usX2Y(card)->chip.dev->bus->busnum, usX2Y(card)->chip.dev->devnum | 364 | usX2Y(card)->dev->bus->busnum, usX2Y(card)->dev->devnum |
366 | ); | 365 | ); |
367 | *cardp = card; | 366 | *cardp = card; |
368 | return 0; | 367 | return 0; |
@@ -432,8 +431,8 @@ static void snd_usX2Y_card_private_free(struct snd_card *card) | |||
432 | usb_free_urb(usX2Y(card)->In04urb); | 431 | usb_free_urb(usX2Y(card)->In04urb); |
433 | if (usX2Y(card)->us428ctls_sharedmem) | 432 | if (usX2Y(card)->us428ctls_sharedmem) |
434 | snd_free_pages(usX2Y(card)->us428ctls_sharedmem, sizeof(*usX2Y(card)->us428ctls_sharedmem)); | 433 | snd_free_pages(usX2Y(card)->us428ctls_sharedmem, sizeof(*usX2Y(card)->us428ctls_sharedmem)); |
435 | if (usX2Y(card)->chip.index >= 0 && usX2Y(card)->chip.index < SNDRV_CARDS) | 434 | if (usX2Y(card)->card_index >= 0 && usX2Y(card)->card_index < SNDRV_CARDS) |
436 | snd_usX2Y_card_used[usX2Y(card)->chip.index] = 0; | 435 | snd_usX2Y_card_used[usX2Y(card)->card_index] = 0; |
437 | } | 436 | } |
438 | 437 | ||
439 | /* | 438 | /* |
@@ -445,7 +444,6 @@ static void usX2Y_usb_disconnect(struct usb_device *device, void* ptr) | |||
445 | struct snd_card *card = ptr; | 444 | struct snd_card *card = ptr; |
446 | struct usX2Ydev *usX2Y = usX2Y(card); | 445 | struct usX2Ydev *usX2Y = usX2Y(card); |
447 | struct list_head *p; | 446 | struct list_head *p; |
448 | usX2Y->chip.shutdown = 1; | ||
449 | usX2Y->chip_status = USX2Y_STAT_CHIP_HUP; | 447 | usX2Y->chip_status = USX2Y_STAT_CHIP_HUP; |
450 | usX2Y_unlinkSeq(&usX2Y->AS04); | 448 | usX2Y_unlinkSeq(&usX2Y->AS04); |
451 | usb_kill_urb(usX2Y->In04urb); | 449 | usb_kill_urb(usX2Y->In04urb); |