Commit 894f3009 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Bjorn Helgaas

media: ttusb-budget: Remove pci_zalloc_coherent() abuse

Switch to a plain kzalloc() instead of pci_zalloc_coherent() to allocate
memory for the USB DMA.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 1291a0d5
...@@ -102,7 +102,6 @@ struct ttusb { ...@@ -102,7 +102,6 @@ struct ttusb {
unsigned int isoc_in_pipe; unsigned int isoc_in_pipe;
void *iso_buffer; void *iso_buffer;
dma_addr_t iso_dma_handle;
struct urb *iso_urb[ISO_BUF_COUNT]; struct urb *iso_urb[ISO_BUF_COUNT];
...@@ -792,26 +791,17 @@ static void ttusb_free_iso_urbs(struct ttusb *ttusb) ...@@ -792,26 +791,17 @@ static void ttusb_free_iso_urbs(struct ttusb *ttusb)
for (i = 0; i < ISO_BUF_COUNT; i++) for (i = 0; i < ISO_BUF_COUNT; i++)
usb_free_urb(ttusb->iso_urb[i]); usb_free_urb(ttusb->iso_urb[i]);
kfree(ttusb->iso_buffer);
pci_free_consistent(NULL,
ISO_FRAME_SIZE * FRAMES_PER_ISO_BUF *
ISO_BUF_COUNT, ttusb->iso_buffer,
ttusb->iso_dma_handle);
} }
static int ttusb_alloc_iso_urbs(struct ttusb *ttusb) static int ttusb_alloc_iso_urbs(struct ttusb *ttusb)
{ {
int i; int i;
ttusb->iso_buffer = pci_zalloc_consistent(NULL, ttusb->iso_buffer = kcalloc(FRAMES_PER_ISO_BUF * ISO_BUF_COUNT,
ISO_FRAME_SIZE * FRAMES_PER_ISO_BUF * ISO_BUF_COUNT, ISO_FRAME_SIZE, GFP_KERNEL);
&ttusb->iso_dma_handle); if (!ttusb->iso_buffer)
if (!ttusb->iso_buffer) {
dprintk("%s: pci_alloc_consistent - not enough memory\n",
__func__);
return -ENOMEM; return -ENOMEM;
}
for (i = 0; i < ISO_BUF_COUNT; i++) { for (i = 0; i < ISO_BUF_COUNT; i++) {
struct urb *urb; struct urb *urb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment