[ 28/78] m68k/mac: Add missing platform check before registering platform devices

From: Greg KH
Date: Wed Apr 11 2012 - 19:16:12 EST


3.3-stable review patch. If anyone has any objections, please let me know.

------------------

From: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>

commit 6cfeba53911d6d2f17ebbd1246893557d5ff5aeb upstream.

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 <geert@xxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
arch/m68k/mac/config.c | 3 +++
1 file changed, 3 insertions(+)

--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -981,6 +981,9 @@ int __init mac_platform_init(void)
{
u8 *swim_base;

+ if (!MACH_IS_MAC)
+ return -ENODEV;
+
/*
* Serial devices
*/


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/