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

[ARM] 4073/1: Prevent s3c24xx drivers from including asm/arch/hardware.h and asm/arch/irqs.h

As reminded in http://lkml.org/lkml/2006/12/23/26, one should use
asm/hardware.h and asm/irq.h but absent-minded devs like me tends to use
asm/arch/hardware.h and/or asm/arch/irqs.h.
This patch aims at preventing such things.

In order to make it work, I had to modify asm-arm/irq.h too so that it can
be included from assembly files.
Also, as a side effect, I had to modify some headers who were using the
asm/arch/hardware.h or asm/arch/irqs.h.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Arnaud Patard and committed by
Russell King
431d2cd9 eb3b4783

+13 -3
+1 -1
include/asm-arm/arch-s3c2410/dma.h
··· 14 14 #define __ASM_ARCH_DMA_H __FILE__ 15 15 16 16 #include <linux/sysdev.h> 17 - #include "hardware.h" 17 + #include <asm/hardware.h> 18 18 19 19 /* 20 20 * This is the maximum DMA address(physical address) that can be DMAd to.
+1 -1
include/asm-arm/arch-s3c2410/entry-macro.S
··· 20 20 #define INTOFFSET (0x14) 21 21 22 22 #include <asm/hardware.h> 23 - #include <asm/arch/irqs.h> 23 + #include <asm/irq.h> 24 24 25 25 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 26 26
+4
include/asm-arm/arch-s3c2410/hardware.h
··· 13 13 #ifndef __ASM_ARCH_HARDWARE_H 14 14 #define __ASM_ARCH_HARDWARE_H 15 15 16 + #ifndef __ASM_HARDWARE_H 17 + #error "Do not include this directly, instead #include <asm/hardware.h>" 18 + #endif 19 + 16 20 #ifndef __ASSEMBLY__ 17 21 18 22 /* external functions for GPIO support
+3
include/asm-arm/arch-s3c2410/irqs.h
··· 12 12 #ifndef __ASM_ARCH_IRQS_H 13 13 #define __ASM_ARCH_IRQS_H __FILE__ 14 14 15 + #ifndef __ASM_ARM_IRQ_H 16 + #error "Do not include this directly, instead #include <asm/irq.h>" 17 + #endif 15 18 16 19 /* we keep the first set of CPU IRQs out of the range of 17 20 * the ISA space, so that the PC104 has them to itself
+4 -1
include/asm-arm/irq.h
··· 19 19 #define NO_IRQ ((unsigned int)(-1)) 20 20 #endif 21 21 22 - struct irqaction; 23 22 24 23 /* 25 24 * Migration helpers ··· 36 37 #define IRQT_HIGH (__IRQT_HIGHLVL) 37 38 #define IRQT_PROBE IRQ_TYPE_PROBE 38 39 40 + #ifndef __ASSEMBLY__ 41 + struct irqaction; 39 42 extern void migrate_irqs(void); 43 + #endif 44 + 40 45 #endif 41 46