[media] drivers: media: usb: b2c2: use usb_*_coherent() instead of pci_*_consistent...
authorChen Gang <gang.chen@asianux.com>
Mon, 23 Sep 2013 02:20:48 +0000 (23:20 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 17 Oct 2013 14:26:41 +0000 (11:26 -0300)
Some architectures do not support PCI, but still support USB, so need
let our usb driver try to use usb_* instead of pci_* to support these
architectures, or can not pass compiling.
The related error (with allmodconfig for arc):
    CC [M]  drivers/media/usb/b2c2/flexcop-usb.o
  drivers/media/usb/b2c2/flexcop-usb.c: In function ‘flexcop_usb_transfer_exit’:
  drivers/media/usb/b2c2/flexcop-usb.c:393: error: implicit declaration of function ‘pci_free_consistent’
  drivers/media/usb/b2c2/flexcop-usb.c: In function ‘flexcop_usb_transfer_init’:
  drivers/media/usb/b2c2/flexcop-usb.c:410: error: implicit declaration of function ‘pci_alloc_consistent’

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/usb/b2c2/flexcop-usb.c

index 8b6275f859088d703fcc2893412dfe5c4ccd58b8..0bd96906339227ec8b3df4e78640fc500be4fb87 100644 (file)
@@ -390,7 +390,7 @@ static void flexcop_usb_transfer_exit(struct flexcop_usb *fc_usb)
                }
 
        if (fc_usb->iso_buffer != NULL)
-               pci_free_consistent(NULL,
+               usb_free_coherent(fc_usb->udev,
                        fc_usb->buffer_size, fc_usb->iso_buffer,
                        fc_usb->dma_addr);
 }
@@ -407,8 +407,8 @@ static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)
                        "each of %d bytes size = %d.\n", B2C2_USB_NUM_ISO_URB,
                        B2C2_USB_FRAMES_PER_ISO, frame_size, bufsize);
 
-       fc_usb->iso_buffer = pci_alloc_consistent(NULL,
-                       bufsize, &fc_usb->dma_addr);
+       fc_usb->iso_buffer = usb_alloc_coherent(fc_usb->udev,
+                       bufsize, GFP_KERNEL, &fc_usb->dma_addr);
        if (fc_usb->iso_buffer == NULL)
                return -ENOMEM;