usb: core: Allow compilation on platforms where NO_DMA=y
authorGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 16 Feb 2016 15:10:57 +0000 (16:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Feb 2016 04:22:55 +0000 (20:22 -0800)
commit58f2266f4019b9d023979de31950d34cce23b43c
tree0eb8d890ab2985385f5eba7ea21759b54b043503
parentef976ea33b4c44d6cd14ee63cb237c6bab40f91b
usb: core: Allow compilation on platforms where NO_DMA=y

Some platforms don't have DMA, but we should still be able to build USB
drivers for these platforms. They could still be used through vhci_hcd,
usbip_host, or maybe something like USB passthrough in UML from a
capable host.

If NO_DMA=y:

    ERROR: "dma_pool_destroy" [drivers/usb/core/usbcore.ko] undefined!
    ERROR: "bad_dma_ops" [drivers/usb/core/usbcore.ko] undefined!
    ERROR: "dma_pool_free" [drivers/usb/core/usbcore.ko] undefined!
    ERROR: "dma_pool_alloc" [drivers/usb/core/usbcore.ko] undefined!
    ERROR: "dma_pool_create" [drivers/usb/core/usbcore.ko] undefined!

Add a few checks for CONFIG_HAS_DMA to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/buffer.c
drivers/usb/core/hcd.c