aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.14/950-0119-dma-bcm2708-Fix-module-compilation-of-CONFIG_DMA_BCM.patch
blob: aff50554a4b8ee16b4c60d021612a9ed18231921 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 6156ba379ce50e8a969e4e87c9e1eddb117a9e4c Mon Sep 17 00:00:00 2001
From: Andrei Gherzan <andrei@gherzan.com>
Date: Mon, 5 Jun 2017 16:40:38 +0100
Subject: [PATCH 119/454] dma-bcm2708: Fix module compilation of
 CONFIG_DMA_BCM2708

bcm2708-dmaengine.c defines functions like bcm_dma_start which are
defined as well in dma-bcm2708.h as inline versions when
CONFIG_DMA_BCM2708 is not defined. This works fine when
CONFIG_DMA_BCM2708 is built in, but when it is selected as module build
fails with redefinition errors because in the build system when
CONFIG_DMA_BCM2708 is selected as module, the macro becomes
CONFIG_DMA_BCM2708_MODULE.

This patch makes the header use CONFIG_DMA_BCM2708_MODULE too when
available.

Fixes https://github.com/raspberrypi/linux/issues/2056

Signed-off-by: Andrei Gherzan <andrei@gherzan.com>
---
 include/linux/platform_data/dma-bcm2708.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/include/linux/platform_data/dma-bcm2708.h
+++ b/include/linux/platform_data/dma-bcm2708.h
@@ -75,7 +75,7 @@ struct bcm2708_dma_cb {
 struct scatterlist;
 struct platform_device;
 
-#ifdef CONFIG_DMA_BCM2708
+#if defined(CONFIG_DMA_BCM2708) || defined(CONFIG_DMA_BCM2708_MODULE)
 
 int bcm_sg_suitable_for_dma(struct scatterlist *sg_ptr, int sg_len);
 void bcm_dma_start(void __iomem *dma_chan_base, dma_addr_t control_block);
@@ -138,6 +138,6 @@ static inline int bcm_dmaman_remove(stru
 	return 0;
 }
 
-#endif /* CONFIG_DMA_BCM2708 */
+#endif /* CONFIG_DMA_BCM2708 || CONFIG_DMA_BCM2708_MODULE */
 
 #endif /* _PLAT_BCM2708_DMA_H */