diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2018-03-16 14:25:40 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-03-16 19:58:27 +0100 |
commit | f29ab49b5388b2f829cf99859bc5f8ad8ec4d06a (patch) | |
tree | d8fb169b5d63e0ae56bd03bcc81c7a7fb041e1df /include/linux/dma-mapping.h | |
parent | 0c8efd610b58cb23cefdfa12015799079aef94ae (diff) | |
download | op-kernel-dev-f29ab49b5388b2f829cf99859bc5f8ad8ec4d06a.zip op-kernel-dev-f29ab49b5388b2f829cf99859bc5f8ad8ec4d06a.tar.gz |
dma-mapping: Convert NO_DMA get_dma_ops() into a real dummy
If NO_DMA=y, get_dma_ops() returns a reference to the
non-existing symbol bad_dma_ops, thus causing a link failure if it is
ever used.
Make get_dma_ops() return NULL instead, to avoid the link failure.
This allows to improve compile-testing, and limits the need to keep on
sprinkling dependencies on HAS_DMA all over the place.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/dma-mapping.h')
-rw-r--r-- | include/linux/dma-mapping.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index eb9eab4..5ea7eec 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -212,14 +212,14 @@ static inline void set_dma_ops(struct device *dev, } #else /* - * Define the dma api to allow compilation but not linking of - * dma dependent code. Code that depends on the dma-mapping - * API needs to set 'depends on HAS_DMA' in its Kconfig + * Define the dma api to allow compilation of dma dependent code. + * Code that depends on the dma-mapping API needs to set 'depends on HAS_DMA' + * in its Kconfig, unless it already depends on <something> || COMPILE_TEST, + * where <something> guarantuees the availability of the dma-mapping API. */ -extern const struct dma_map_ops bad_dma_ops; static inline const struct dma_map_ops *get_dma_ops(struct device *dev) { - return &bad_dma_ops; + return NULL; } #endif |