usb: gadget: don't fail when DMA isn't present
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 12 Jul 2013 15:06:21 +0000 (11:06 -0400)
committerFelipe Balbi <balbi@ti.com>
Mon, 15 Jul 2013 10:05:29 +0000 (13:05 +0300)
commit908b961326b2ecfbf494c9b2f206847d925f269d
tree2f1e3259e4f63508015c6b4738752652fb1bf5d1
parent91f6b84739e29069670f54651340d2c20e4e7399
usb: gadget: don't fail when DMA isn't present

When CONFIG_HAS_DMA isn't enabled, the UDC core gets build errors:

drivers/built-in.o: In function `dma_set_coherent_mask':
include/linux/dma-mapping.h:93: undefined reference to `dma_supported'
include/linux/dma-mapping.h:93: undefined reference to `dma_supported'
drivers/built-in.o: In function `usb_gadget_unmap_request':
drivers/usb/gadget/udc-core.c:91: undefined reference to `dma_unmap_sg'
drivers/usb/gadget/udc-core.c:96: undefined reference to `dma_unmap_single'
drivers/built-in.o: In function `usb_gadget_map_request':
drivers/usb/gadget/udc-core.c:62: undefined reference to `dma_map_sg'
drivers/usb/gadget/udc-core.c:71: undefined reference to `dma_map_single'
drivers/usb/gadget/udc-core.c:74: undefined reference to `dma_mapping_error'

Prevent this by protecting the DMA API routines with preprocessor tests.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc-core.c