• Geert Uytterhoeven's avatar
    spi: core: Protect DMA code by #ifdef CONFIG_HAS_DMA · 2de440f5
    Geert Uytterhoeven authored
    If NO_DMA=y:
    
    drivers/built-in.o: In function `spi_map_buf':
    spi.c:(.text+0x21bc60): undefined reference to `dma_map_sg'
    drivers/built-in.o: In function `spi_unmap_buf.isra.33':
    spi.c:(.text+0x21c32e): undefined reference to `dma_unmap_sg'
    make[3]: *** [vmlinux] Error 1
    
    Protect the DMA code by #ifdef CONFIG_HAS_DMA to fix this:
      - Extract __spi_map_msg() from spi_map_msg(),
      - Provide dummy definitions of __spi_map_msg() and spi_unmap_msg() if
        !CONFIG_HAS_DMA.
    Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: default avatarMark Brown <broonie@linaro.org>
    2de440f5
spi.c 60.5 KB