• Alan Stern's avatar
    usb: gadget: don't fail when DMA isn't present · 908b9613
    Alan Stern authored
    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: default avatarAlan Stern <stern@rowland.harvard.edu>
    CC: Geert Uytterhoeven <geert@linux-m68k.org>
    Acked-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
    Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
    908b9613
udc-core.c 14.2 KB