* [PATCH]snd-usb-usx2y 0.7.2a
@ 2004-09-12 9:33 Karsten Wiese
2004-09-13 16:30 ` Takashi Iwai
0 siblings, 1 reply; 7+ messages in thread
From: Karsten Wiese @ 2004-09-12 9:33 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 115 bytes --]
Hi Takashi,
I found some improvements in the current kernel's version.
Please also apply in cvs.
thanks,
Karsten
[-- Attachment #2: snd-usb-usx2y.patch.0.7.2a --]
[-- Type: text/x-diff, Size: 4543 bytes --]
Index: alsa-kernel/usb/usx2y/usX2Yhwdep.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usx2y/usX2Yhwdep.c,v
retrieving revision 1.1
diff -u -r1.1 usX2Yhwdep.c
--- alsa-kernel/usb/usx2y/usX2Yhwdep.c 3 Aug 2004 14:22:48 -0000 1.1
+++ alsa-kernel/usb/usx2y/usX2Yhwdep.c 11 Sep 2004 20:46:12 -0000
@@ -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
diff -u -r1.1 usbusx2y.c
--- alsa-kernel/usb/usx2y/usbusx2y.c 3 Aug 2004 14:22:48 -0000 1.1
+++ alsa-kernel/usb/usx2y/usbusx2y.c 11 Sep 2004 20:46:13 -0000
@@ -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
diff -u -r1.2 usbusx2yaudio.c
--- alsa-kernel/usb/usx2y/usbusx2yaudio.c 5 Aug 2004 09:46:20 -0000 1.2
+++ alsa-kernel/usb/usx2y/usbusx2yaudio.c 11 Sep 2004 20:46:15 -0000
@@ -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;
}
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH]snd-usb-usx2y 0.7.2a
2004-09-12 9:33 [PATCH]snd-usb-usx2y 0.7.2a Karsten Wiese
@ 2004-09-13 16:30 ` Takashi Iwai
2004-09-13 17:08 ` Karsten Wiese
0 siblings, 1 reply; 7+ messages in thread
From: Takashi Iwai @ 2004-09-13 16:30 UTC (permalink / raw)
To: Karsten Wiese; +Cc: alsa-devel
At Sun, 12 Sep 2004 11:33:46 +0200,
Karsten Wiese wrote:
>
> [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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH]snd-usb-usx2y 0.7.2a
2004-09-13 16:30 ` Takashi Iwai
@ 2004-09-13 17:08 ` Karsten Wiese
2004-09-13 17:32 ` Takashi Iwai
0 siblings, 1 reply; 7+ messages in thread
From: Karsten Wiese @ 2004-09-13 17:08 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
Am Montag 13 September 2004 18:30 schrieb Takashi Iwai:
> At Sun, 12 Sep 2004 11:33:46 +0200,
>
> Karsten Wiese wrote:
> > [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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH]snd-usb-usx2y 0.7.2a
2004-09-13 17:08 ` Karsten Wiese
@ 2004-09-13 17:32 ` Takashi Iwai
2004-09-13 18:04 ` Karsten Wiese
0 siblings, 1 reply; 7+ messages in thread
From: Takashi Iwai @ 2004-09-13 17:32 UTC (permalink / raw)
To: Karsten Wiese; +Cc: alsa-devel
At Mon, 13 Sep 2004 19:08:08 +0200,
Karsten Wiese wrote:
>
> Am Montag 13 September 2004 18:30 schrieb Takashi Iwai:
> > At Sun, 12 Sep 2004 11:33:46 +0200,
> >
> > Karsten Wiese wrote:
> > > [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.
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH]snd-usb-usx2y 0.7.2a
2004-09-13 17:32 ` Takashi Iwai
@ 2004-09-13 18:04 ` Karsten Wiese
2004-09-13 18:16 ` Karsten Wiese
0 siblings, 1 reply; 7+ messages in thread
From: Karsten Wiese @ 2004-09-13 18:04 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
Am Montag 13 September 2004 19:32 schrieb Takashi Iwai:
> At Mon, 13 Sep 2004 19:08:08 +0200,
>
> Karsten Wiese wrote:
> > Am Montag 13 September 2004 18:30 schrieb Takashi Iwai:
> > > At Sun, 12 Sep 2004 11:33:46 +0200,
> > >
> > > Karsten Wiese wrote:
> > > > [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.
>
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH]snd-usb-usx2y 0.7.2a
2004-09-13 18:04 ` Karsten Wiese
@ 2004-09-13 18:16 ` Karsten Wiese
2004-09-15 10:18 ` Takashi Iwai
0 siblings, 1 reply; 7+ messages in thread
From: Karsten Wiese @ 2004-09-13 18:16 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
Am Montag 13 September 2004 20:04 schrieb Karsten Wiese:
> Am Montag 13 September 2004 19:32 schrieb Takashi Iwai:
> > At Mon, 13 Sep 2004 19:08:08 +0200,
> >
> > Karsten Wiese wrote:
> > > Am Montag 13 September 2004 18:30 schrieb Takashi Iwai:
> > > > At Sun, 12 Sep 2004 11:33:46 +0200,
> > > >
> > > > Karsten Wiese wrote:
> > > > > [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.
> >
> > 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).
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Re: [PATCH]snd-usb-usx2y 0.7.2a
2004-09-13 18:16 ` Karsten Wiese
@ 2004-09-15 10:18 ` Takashi Iwai
0 siblings, 0 replies; 7+ messages in thread
From: Takashi Iwai @ 2004-09-15 10:18 UTC (permalink / raw)
To: Karsten Wiese; +Cc: alsa-devel
At Mon, 13 Sep 2004 20:16:50 +0200,
Karsten Wiese wrote:
>
> Am Montag 13 September 2004 20:04 schrieb Karsten Wiese:
> > Am Montag 13 September 2004 19:32 schrieb Takashi Iwai:
> > > At Mon, 13 Sep 2004 19:08:08 +0200,
> > >
> > > Karsten Wiese wrote:
> > > > Am Montag 13 September 2004 18:30 schrieb Takashi Iwai:
> > > > > At Sun, 12 Sep 2004 11:33:46 +0200,
> > > > >
> > > > > Karsten Wiese wrote:
> > > > > > [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.
> > >
> > > 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).
>
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-09-15 10:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-12 9:33 [PATCH]snd-usb-usx2y 0.7.2a Karsten Wiese
2004-09-13 16:30 ` Takashi Iwai
2004-09-13 17:08 ` Karsten Wiese
2004-09-13 17:32 ` Takashi Iwai
2004-09-13 18:04 ` Karsten Wiese
2004-09-13 18:16 ` Karsten Wiese
2004-09-15 10:18 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.