lkml.org 
[lkml]   [2005]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectRe: [PATCH] USB and Driver Core patches for 2.6.10
    Date
    From
    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 */
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:09    [W:0.027 / U:59.476 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site