diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index eb9eab4ecd6d..5ea7eec83c0f 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 || COMPILE_TEST, + * where 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