Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 574780d5 authored by Guido Guenther's avatar Guido Guenther Committed by David S. Miller
Browse files

[SPARC64]: Oops in pci_alloc_consistent with cingergyT2



From: Guido Guenther <agx@sigxcpu.org>

- Use correct API for allocating and freeing DMA buffers.

Acked-by: default avatarJohannes Stezenbach <js@linuxtv.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f6ff56cd
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -276,7 +276,7 @@ static void cinergyt2_free_stream_urbs (struct cinergyt2 *cinergyt2)
		if (cinergyt2->stream_urb[i])
		if (cinergyt2->stream_urb[i])
			usb_free_urb(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);
			    cinergyt2->streambuf, cinergyt2->streambuf_dmahandle);
}
}


@@ -284,9 +284,8 @@ static int cinergyt2_alloc_stream_urbs (struct cinergyt2 *cinergyt2)
{
{
	int i;
	int i;


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