From 7224c0d1045327d637dab2c90777b6d5ec6d6804 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Fri, 30 Mar 2012 15:52:09 +1000 Subject: [PATCH 1/3] m68k: include asm/cmpxchg.h in our m68k atomic.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After commit 9ffc93f203c18a70623f21950f1dd473c9ec48cd ("Remove all CC init/main.o In file included from include/linux/mm.h:15:0, from include/linux/ring_buffer.h:5, from include/linux/ftrace_event.h:4, from include/trace/syscall.h:6, from include/linux/syscalls.h:78, from init/main.c:16: include/linux/debug_locks.h: In function ‘__debug_locks_off’: include/linux/debug_locks.h:16:2: error: implicit declaration of function ‘xchg’ There is no indirect inclusions of the new asm/cmpxchg.h for m68k here. Looking at most other architectures they include asm/cmpxchg.h in their asm/atomic.h. M68k currently does not do this. Including this in atomic.h fixes all m68k build problems. Signed-off-by: Greg Ungerer Acked-by: David Howells Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/atomic.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/m68k/include/asm/atomic.h b/arch/m68k/include/asm/atomic.h index 336e6173794f..f4e32de263a7 100644 --- a/arch/m68k/include/asm/atomic.h +++ b/arch/m68k/include/asm/atomic.h @@ -3,6 +3,7 @@ #include #include +#include /* * Atomic operations that C can't guarantee us. Useful for From 6cfeba53911d6d2f17ebbd1246893557d5ff5aeb Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Sun, 18 Mar 2012 13:21:38 +0100 Subject: [PATCH 2/3] m68k/mac: Add missing platform check before registering platform devices On multi-platform kernels, the Mac platform devices should be registered when running on Mac only. Else it may crash later. Signed-off-by: Geert Uytterhoeven Cc: stable@vger.kernel.org --- arch/m68k/mac/config.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 96fa6ed7e799..d9f62e0f46c0 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -980,6 +980,9 @@ int __init mac_platform_init(void) { u8 *swim_base; + if (!MACH_IS_MAC) + return -ENODEV; + /* * Serial devices */ From 450aed725c9a53282483c48ebd012feefae94a07 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Sun, 18 Mar 2012 13:20:27 +0100 Subject: [PATCH 3/3] m68k/q40: Add missing platform check before registering platform devices On multi-platform kernels, the Q40/Q60 platform devices should be registered when running on Q40/Q60 only. Else it may crash later. Signed-off-by: Geert Uytterhoeven --- arch/m68k/q40/config.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index 512adb64f7dd..8a1ce327c963 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c @@ -334,6 +334,9 @@ static __init int q40_add_kbd_device(void) { struct platform_device *pdev; + if (!MACH_IS_Q40) + return -ENODEV; + pdev = platform_device_register_simple("q40kbd", -1, NULL, 0); if (IS_ERR(pdev)) return PTR_ERR(pdev);