snd-usb-usx2y 0.7.2a
PATCH 1/1 snd-usb-usx2y 0.7.2a
Hi Takashi,
I found some improvements in the current kernel's version. Please also apply in cvs.
thanks,
Karsten
Index: alsa-kernel/usb/usx2y/usX2Yhwdep.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usx2y/usX2Yhwdep.c,v retrieving revision 1.1
usb/usx2y/usX2Yhwdep.c +36 -29
@@ -211,43 +211,50 @@static int snd_usX2Y_hwdep_dsp_load (snd_hwdep_t *hw,snd_hwdep_dsp_image_t *dsp) { -int lret, err; -char * buf; +usX2Ydev_t *priv = hw->private_data; +int lret, err = -EINVAL ;snd_printdd ("dsp_load %s\n" , dsp->name); - buf = dsp->image; - - err = -EINVAL ;if (access_ok (VERIFY_READ , dsp->image, dsp->length)) { -struct usb_device * dev = ((usX2Ydev_t *)hw->private_data)->chip.dev; - buf =kmalloc (dsp->length,GFP_KERNEL ); -copy_from_user (buf, dsp->image, dsp->length); -if ((err =usb_set_interface (dev,0 ,1 ))) +struct usb_device * dev = priv->chip.dev; +char *buf =kmalloc (dsp->length,GFP_KERNEL ); +if (!buf) +return -ENOMEM ; +if (copy_from_user (buf, dsp->image, dsp->length)) { +kfree (buf); +return -EFAULT ; + } + err =usb_set_interface (dev,0 ,1 ); +if (err)snd_printk ("usb_set_interface error \n" );else err =usb_bulk_msg (dev,usb_sndbulkpipe (dev,2 ), buf, dsp->length, &lret,6 *HZ );kfree (buf); } -if (!err &&1 == dsp->index) -do { -set_current_state (TASK_UNINTERRUPTIBLE ); -schedule_timeout (HZ /4 );// give the device some time -if ((err =usX2Y_AsyncSeq04_init ((usX2Ydev_t *)hw->private_data))) { -snd_printk ("usX2Y_AsyncSeq04_init error \n" ); -break ; - } -if ((err =usX2Y_In04_init ((usX2Ydev_t *)hw->private_data))) { -snd_printk ("usX2Y_In04_init error \n" ); -break ; - } -if ((err =usX2Y_create_alsa_devices (hw->card))) { -snd_printk ("usX2Y_create_alsa_devices error %i \n" , err); -snd_card_free (hw->card); -break ; - } - ((usX2Ydev_t *)hw->private_data)->chip_status |=USX2Y_STAT_CHIP_INIT ; -snd_printdd ("%s: alsa all started\n" , hw->name); - }while (0 ); +if (err) +return err; +if (dsp->index ==1 ) { +set_current_state (TASK_UNINTERRUPTIBLE ); +schedule_timeout (HZ /4 );// give the device some time + err =usX2Y_AsyncSeq04_init (priv); +if (err) { +snd_printk ("usX2Y_AsyncSeq04_init error \n" ); +return err; + } + err =usX2Y_In04_init (priv); +if (err) { +snd_printk ("usX2Y_In04_init error \n" ); +return err; + } + err =usX2Y_create_alsa_devices (hw->card); +if (err) { +snd_printk ("usX2Y_create_alsa_devices error %i \n" , err); +snd_card_free (hw->card); +return err; + } + priv->chip_status |=USX2Y_STAT_CHIP_INIT ; +snd_printdd ("%s: alsa all started\n" , hw->name); + }return err; }
Index: alsa-kernel/usb/usx2y/usbusx2y.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usx2y/usbusx2y.c,v retrieving revision 1.1
usb/usx2y/usbusx2y.c +2 -2
@@ -346,11 +346,11 @@ device->descriptor.idProduct !=USB_ID_US224 && device->descriptor.idProduct != USB_ID_US428) || !(card = usX2Y_create_card(device))) - return 0; + return NULL;if ((err =usX2Y_hwdep_new (card, device)) <0 || (err =snd_card_register (card)) <0 ) {snd_card_free (card); -return 0 ; +return NULL ; }return card; }
Index: alsa-kernel/usb/usx2y/usbusx2yaudio.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usx2y/usbusx2yaudio.c,v retrieving revision 1.2
usb/usx2y/usbusx2yaudio.c +4 -4
@@ -411,7 +411,7 @@if (free_tb)kfree ((*urb)->transfer_buffer);usb_free_urb (*urb); - *urb =0 ; + *urb =NULL ; } }/*
@@ -427,7 +427,7 @@if (subs->tmpbuf) {kfree (subs->tmpbuf); - subs->tmpbuf =0 ; + subs->tmpbuf =NULL ; } }
@@ -794,7 +794,7 @@return err;snd_printdd ("starting capture pipe for playpipe\n" );usX2Y_urbs_allocate (capsubs); - capsubs->completed_urb =0 ; + capsubs->completed_urb =NULL ; {DECLARE_WAITQUEUE (wait, current);add_wait_queue (&capsubs->wait_queue, &wait);
@@ -838,7 +838,7 @@ } } } - subs->completed_urb =0 ; + subs->completed_urb =NULL ; subs->next_urb_complete =-1 ; subs->stalled =0 ; }
At Sun, 12 Sep 2004 11:33:46 +0200,
Quoted 6 lines · Karsten Wiese
[1 <text/plain; us-ascii (7bit)>]
Hi Takashi,I found some improvements in the current kernel's version. Please also apply in cvs.
Could you send the summary and the description of the patch for changelog?
thanks,
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
Am Montag 13 September 2004 18:30 schrieb Takashi Iwai:
Quoted 11 lines
At Sun, 12 Sep 2004 11:33:46 +0200,
Quoted 5 lines · Karsten Wiese
[1 <text/plain; us-ascii (7bit)>]
Hi Takashi,I found some improvements in the current kernel's version. Please also apply in cvs.
Could you send the summary and the description of the patch for changelog?
summary:
Coding style changes and sanity checks
ported back from kernel 2.6.9-rc1-bk12.
description:
- Use NULL instead of 0 for pointers
- check results of kmalloc() and copy_from_user() in snd_usX2Y_hwdep_dsp_load()
- unnest initialisation calls in snd_usX2Y_hwdep_dsp_load()
thanks,
Karsten
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
At Mon, 13 Sep 2004 19:08:08 +0200,
Quoted 8 lines · Karsten Wiese
Am Montag 13 September 2004 18:30 schrieb Takashi Iwai:
Quoted 6 lines
At Sun, 12 Sep 2004 11:33:46 +0200,
Quoted 3 lines · Karsten Wiese
[1 <text/plain; us-ascii (7bit)>]
Hi Takashi,
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
I found some improvements in the current kernel's version. Please also apply in cvs.
Could you send the summary and the description of the patch for changelog?
summary:
Coding style changes and sanity checks
ported back from kernel 2.6.9-rc1-bk12.
Did it a simply backport from linus bk? Or did you add your own changes? If you added changes, please split the patch into two pieces, the backport (2.6-bk-sync) and your changes.
thanks,
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
Am Montag 13 September 2004 19:32 schrieb Takashi Iwai:
Quoted 16 lines
At Mon, 13 Sep 2004 19:08:08 +0200,
Quoted 13 lines · Karsten Wiese
Am Montag 13 September 2004 18:30 schrieb Takashi Iwai:
Quoted 11 lines
At Sun, 12 Sep 2004 11:33:46 +0200,
Quoted 5 lines · Karsten Wiese
[1 <text/plain; us-ascii (7bit)>]
Hi Takashi,I found some improvements in the current kernel's version. Please also apply in cvs.
Could you send the summary and the description of the patch for changelog?
Quoted 7 lines
Quoted 3 lines
summary:
Coding style changes and sanity checks
ported back from kernel 2.6.9-rc1-bk12.Did it a simply backport from linus bk? Or did you add your own changes? If you added changes, please split the patch into two pieces, the backport (2.6-bk-sync) and your changes.
Erm, I found those changes while toying with the voluntary preemption patches. I patched the kernel 2.6.8 with stuff from people.redhat.com/~mingo up to bk12.
Didn't add any change myself.
And don't know who did the changes for shure.
A guess would be Alexander Viro as there is a note about him having changed "usx2y" in the 2.6.9-rc2 announcement (but no details).
thanks,
Karsten
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
Am Montag 13 September 2004 20:04 schrieb Karsten Wiese:
Quoted 25 lines
Am Montag 13 September 2004 19:32 schrieb Takashi Iwai:
Quoted 16 lines
At Mon, 13 Sep 2004 19:08:08 +0200,
Quoted 13 lines · Karsten Wiese
Am Montag 13 September 2004 18:30 schrieb Takashi Iwai:
Quoted 11 lines
At Sun, 12 Sep 2004 11:33:46 +0200,
Quoted 5 lines · Karsten Wiese
[1 <text/plain; us-ascii (7bit)>]
Hi Takashi,I found some improvements in the current kernel's version. Please also apply in cvs.
Could you send the summary and the description of the patch for changelog?
Quoted 7 lines
Quoted 3 lines
summary:
Coding style changes and sanity checks
ported back from kernel 2.6.9-rc1-bk12.Did it a simply backport from linus bk? Or did you add your own changes? If you added changes, please split the patch into two pieces, the backport (2.6-bk-sync) and your changes.
Quoted 7 lines
Erm, I found those changes while toying with the voluntary preemption patches. I patched the kernel 2.6.8 with stuff from people.redhat.com/~mingo up to bk12.
Didn't add any change myself.
And don't know who did the changes for shure.
A guess would be Alexander Viro as there is a note about him having changed "usx2y" in the 2.6.9-rc2 announcement (but no details).
Found the bitkeeper log entry. See:
http://linux.bkbits.net:8080/linux-2.6/cset%401.1832.1.37
thanks,
Karsten
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
At Mon, 13 Sep 2004 20:16:50 +0200,
Quoted 35 lines · Karsten Wiese
Am Montag 13 September 2004 20:04 schrieb Karsten Wiese:
Quoted 25 lines
Am Montag 13 September 2004 19:32 schrieb Takashi Iwai:
Quoted 16 lines
At Mon, 13 Sep 2004 19:08:08 +0200,
Quoted 13 lines · Karsten Wiese
Am Montag 13 September 2004 18:30 schrieb Takashi Iwai:
Quoted 11 lines
At Sun, 12 Sep 2004 11:33:46 +0200,
Quoted 5 lines · Karsten Wiese
[1 <text/plain; us-ascii (7bit)>]
Hi Takashi,I found some improvements in the current kernel's version. Please also apply in cvs.
Could you send the summary and the description of the patch for changelog?
Quoted 7 lines
Quoted 3 lines
summary:
Coding style changes and sanity checks
ported back from kernel 2.6.9-rc1-bk12.Did it a simply backport from linus bk? Or did you add your own changes? If you added changes, please split the patch into two pieces, the backport (2.6-bk-sync) and your changes.
Quoted 7 lines
Erm, I found those changes while toying with the voluntary preemption patches. I patched the kernel 2.6.8 with stuff from people.redhat.com/~mingo up to bk12.
Didn't add any change myself.
And don't know who did the changes for shure.
A guess would be Alexander Viro as there is a note about him having changed "usx2y" in the 2.6.9-rc2 announcement (but no details).
Quoted 2 lines
Found the bitkeeper log entry. See:
http://linux.bkbits.net:8080/linux-2.6/cset%401.1832.1.37
Thanks, I applied it now.
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam Camcorder. More prizes in the weekly Lunch Hour Challenge. Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m