Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: OMAP1: Remove duplicated DMA channel definitions

Similarly than with OMAP2 there are many DMA channel definitions that have
been moved or redefined in drivers using them and we can remove them from
dma.h.

There is exception with MMC that arch/arm/mach-omap1/devices.c is using
MMC DMA channel definitions for setting platform data but those can be well
replaced with numeric values.

Remove dma.h include from arch/arm/mach-omap1/devices.c and use a script
below for dropping duplicated definitions and for replacing definitions
with DMA channel numbers.

grep '#define OMAP_DMA' arch/arm/mach-omap1/dma.h | while read -r i; do \
DDEF=`echo $i |cut -d ' ' -f 1-2`; \
DEF=`echo $DDEF |cut -d ' ' -f 2`; \
CH=`echo $i |cut -d ' ' -f 3`; \
if [ `git grep -c "$DDEF" |wc -l` -gt 1 ]; then \
echo "removing" $DEF; \
sed -i "s/${DEF}/${CH}/" arch/arm/mach-omap1/devices.c; \
sed -i "/${DDEF}/d" arch/arm/mach-omap1/dma.h; \
fi; \
done

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

authored by

Jarkko Nikula and committed by
Tony Lindgren
bf2920aa c821c462

+4 -13
+4 -5
arch/arm/mach-omap1/devices.c
··· 30 30 31 31 #include "common.h" 32 32 #include "clock.h" 33 - #include "dma.h" 34 33 #include "mmc.h" 35 34 #include "sram.h" 36 35 ··· 222 223 case 0: 223 224 base = OMAP1_MMC1_BASE; 224 225 irq = INT_MMC; 225 - rx_req = OMAP_DMA_MMC_RX; 226 - tx_req = OMAP_DMA_MMC_TX; 226 + rx_req = 22; 227 + tx_req = 21; 227 228 break; 228 229 case 1: 229 230 if (!cpu_is_omap16xx()) 230 231 return; 231 232 base = OMAP1_MMC2_BASE; 232 233 irq = INT_1610_MMC2; 233 - rx_req = OMAP_DMA_MMC2_RX; 234 - tx_req = OMAP_DMA_MMC2_TX; 234 + rx_req = 55; 235 + tx_req = 54; 235 236 break; 236 237 default: 237 238 continue;
-8
arch/arm/mach-omap1/dma.h
··· 20 20 #define __OMAP1_DMA_CHANNEL_H 21 21 22 22 /* DMA channels for omap1 */ 23 - #define OMAP_DMA_NO_DEVICE 0 24 23 #define OMAP_DMA_UART3_TX 18 25 24 #define OMAP_DMA_UART3_RX 19 26 - #define OMAP_DMA_CAMERA_IF_RX 20 27 - #define OMAP_DMA_MMC_TX 21 28 - #define OMAP_DMA_MMC_RX 22 29 - #define OMAP_DMA_USB_W2FC_RX0 26 30 - #define OMAP_DMA_USB_W2FC_TX0 29 31 25 32 26 /* These are only for 1610 */ 33 - #define OMAP_DMA_MMC2_TX 54 34 - #define OMAP_DMA_MMC2_RX 55 35 27 36 28 #endif /* __OMAP1_DMA_CHANNEL_H */