Re: [PATCH] USB and Driver Core patches for 2.6.10

Greg KH
2005-01-08T08:02:35Z

ChangeSet 1.1938.446.16, 2004/12/15 16:33:06-08:00, david-b@pacbell.net

[PATCH] USB: ALSA and usb_dev->ep[] (4/15)

Makes an ALSA audio driver stop referencing the udev->epmaxpacket[] arrays.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>

sound/usb/usx2y/usbusx2yaudio.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)

diff -Nru a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
--- a/sound/usb/usx2y/usbusx2yaudio.c 2005-01-07 15:49:29 -08:00
+++ b/sound/usb/usx2y/usbusx2yaudio.c 2005-01-07 15:49:29 -08:00
@@ -449,12 +449,16 @@
int i;
int is_playback = subs == subs->usX2Y->substream[SNDRV_PCM_STREAM_PLAYBACK];
struct usb_device *dev = subs->usX2Y->chip.dev;
+ struct usb_host_endpoint *ep;

snd_assert(!subs->prepared, return 0);

if (is_playback) { /* allocate a temporary buffer for playback */
subs->datapipe = usb_sndisocpipe(dev, subs->endpoint);
- subs->maxpacksize = dev->epmaxpacketout[subs->endpoint];
+ ep = dev->ep_out[subs->endpoint];
+ if (!ep)
+ return -EINVAL;
+ subs->maxpacksize = ep->desc.wMaxPacketSize;
if (NULL == subs->tmpbuf) {
subs->tmpbuf = kcalloc(NRPACKS, subs->maxpacksize, GFP_KERNEL);
if (NULL == subs->tmpbuf) {
@@ -464,7 +468,10 @@
}
} else {
subs->datapipe = usb_rcvisocpipe(dev, subs->endpoint);
- subs->maxpacksize = dev->epmaxpacketin[subs->endpoint];
+ ep = dev->ep_in[subs->endpoint];
+ if (!ep)
+ return -EINVAL;
+ subs->maxpacksize = ep->desc.wMaxPacketSize;
}

/* allocate and initialize data urbs */