Skip to content

Commit

Permalink
[SPARC64]: Oops in pci_alloc_consistent with cingergyT2
Browse files Browse the repository at this point in the history
From: Guido Guenther <agx@sigxcpu.org>

- Use correct API for allocating and freeing DMA buffers.

Acked-by: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Guido Guenther authored and David S. Miller committed Nov 16, 2005
1 parent f6ff56c commit 574780d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/media/dvb/cinergyT2/cinergyT2.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,17 +276,16 @@ static void cinergyt2_free_stream_urbs (struct cinergyt2 *cinergyt2)
if (cinergyt2->stream_urb[i])
usb_free_urb(cinergyt2->stream_urb[i]);

pci_free_consistent(NULL, STREAM_URB_COUNT*STREAM_BUF_SIZE,
usb_buffer_free(cinergyt2->udev, STREAM_URB_COUNT*STREAM_BUF_SIZE,
cinergyt2->streambuf, cinergyt2->streambuf_dmahandle);
}

static int cinergyt2_alloc_stream_urbs (struct cinergyt2 *cinergyt2)
{
int i;

cinergyt2->streambuf = pci_alloc_consistent(NULL,
STREAM_URB_COUNT*STREAM_BUF_SIZE,
&cinergyt2->streambuf_dmahandle);
cinergyt2->streambuf = usb_buffer_alloc(cinergyt2->udev, STREAM_URB_COUNT*STREAM_BUF_SIZE,
SLAB_KERNEL, &cinergyt2->streambuf_dmahandle);
if (!cinergyt2->streambuf) {
dprintk(1, "failed to alloc consistent stream memory area, bailing out!\n");
return -ENOMEM;
Expand Down

0 comments on commit 574780d

Please sign in to comment.