diff options
author | Christoph Hellwig <hch@lst.de> | 2018-01-10 21:03:20 +0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2018-01-18 03:02:46 +0300 |
commit | 8d669f93b4b1405946af77a155c1df4fe1b526b1 (patch) | |
tree | 5467827e62ee30d1dfa4425acf986ae946ecb164 /drivers/media | |
parent | 894f3009d69c6f29f06443acbafb1c2f63271998 (diff) | |
download | linux-8d669f93b4b1405946af77a155c1df4fe1b526b1.tar.xz |
media: ttusb-dec: 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: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/usb/ttusb-dec/ttusb_dec.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c index cdefb5dfbbdc..4d5acdf578a6 100644 --- a/drivers/media/usb/ttusb-dec/ttusb_dec.c +++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c @@ -127,7 +127,6 @@ struct ttusb_dec { struct urb *irq_urb; dma_addr_t irq_dma_handle; void *iso_buffer; - dma_addr_t iso_dma_handle; struct urb *iso_urb[ISO_BUF_COUNT]; int iso_stream_count; struct mutex iso_mutex; @@ -1185,11 +1184,7 @@ static void ttusb_dec_free_iso_urbs(struct ttusb_dec *dec) for (i = 0; i < ISO_BUF_COUNT; i++) usb_free_urb(dec->iso_urb[i]); - - pci_free_consistent(NULL, - ISO_FRAME_SIZE * (FRAMES_PER_ISO_BUF * - ISO_BUF_COUNT), - dec->iso_buffer, dec->iso_dma_handle); + kfree(dec->iso_buffer); } static int ttusb_dec_alloc_iso_urbs(struct ttusb_dec *dec) @@ -1198,15 +1193,10 @@ static int ttusb_dec_alloc_iso_urbs(struct ttusb_dec *dec) dprintk("%s\n", __func__); - dec->iso_buffer = pci_zalloc_consistent(NULL, - ISO_FRAME_SIZE * (FRAMES_PER_ISO_BUF * ISO_BUF_COUNT), - &dec->iso_dma_handle); - - if (!dec->iso_buffer) { - dprintk("%s: pci_alloc_consistent - not enough memory\n", - __func__); + dec->iso_buffer = kcalloc(FRAMES_PER_ISO_BUF * ISO_BUF_COUNT, + ISO_FRAME_SIZE, GFP_KERNEL); + if (!dec->iso_buffer) return -ENOMEM; - } for (i = 0; i < ISO_BUF_COUNT; i++) { struct urb *urb; |