powerpc/pmac: Don't register pmac PIC syscore ops when HW not present
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 31 May 2011 08:01:23 +0000 (18:01 +1000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 31 May 2011 11:30:20 +0000 (20:30 +0900)
The Apple custom PIC only exist in some earlier machine models,
anything with an MPIC will crash on suspend if we register those
syscore ops unconditionally.

This is a regression caused by commit f5a592f7d74e ("PM / PowerPC: Use
struct syscore_ops instead of sysdevs for PM")

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/powerpc/platforms/powermac/pic.c

index 9089b04211919506cb1a443025d0f058d5deff3c..7667db448aa73cc58aacaf72e74fa0c5a2339fc6 100644 (file)
@@ -715,7 +715,8 @@ static struct syscore_ops pmacpic_syscore_ops = {
 
 static int __init init_pmacpic_syscore(void)
 {
-       register_syscore_ops(&pmacpic_syscore_ops);
+       if (pmac_irq_hw[0])
+               register_syscore_ops(&pmacpic_syscore_ops);
        return 0;
 }