sparc32: cleanup code for pci init
authorSam Ravnborg <sam@ravnborg.org>
Sun, 17 Apr 2011 11:49:55 +0000 (13:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Apr 2011 05:11:39 +0000 (22:11 -0700)
Move the ifdeffery to a header file to make the logic more
obvious where we decide between PCI or SBUS init

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/include/asm/pcic.h
arch/sparc/kernel/irq_32.c
arch/sparc/kernel/time_32.c

index f20ef562b265290f71d66c755368af1a97cdd786..7eb5d78f5211d04782430eeb8c71b8083522f22f 100644 (file)
@@ -29,11 +29,17 @@ struct linux_pcic {
        int                     pcic_imdim;
 };
 
-extern int pcic_probe(void);
-/* Erm... MJ redefined pcibios_present() so that it does not work early. */
+#ifdef CONFIG_PCI
 extern int pcic_present(void);
+extern int pcic_probe(void);
+extern void pci_time_init(void);
 extern void sun4m_pci_init_IRQ(void);
-
+#else
+static inline int pcic_present(void) { return 0; }
+static inline int pcic_probe(void) { return 0; }
+static inline void pci_time_init(void) {}
+static inline void sun4m_pci_init_IRQ(void) {}
+#endif
 #endif
 
 /* Size of PCI I/O space which we relocate. */
index 7c93df4099cb168f0808815d19d69f47ab3ccc92..b2dbb4ba860815f2a0a1eb065e4def197b3f9062 100644 (file)
@@ -607,14 +607,11 @@ void __init init_IRQ(void)
                break;
 
        case sun4m:
-#ifdef CONFIG_PCI
                pcic_probe();
-               if (pcic_present()) {
+               if (pcic_present())
                        sun4m_pci_init_IRQ();
-                       break;
-               }
-#endif
-               sun4m_init_IRQ();
+               else
+                       sun4m_init_IRQ();
                break;
 
        case sun4d:
index 4e236391b6359ab59223034c61892c6b3fce7a28..b6184030010146e04cc9f5ecb86c305662377be3 100644 (file)
@@ -228,14 +228,10 @@ static void __init sbus_time_init(void)
 
 void __init time_init(void)
 {
-#ifdef CONFIG_PCI
-       extern void pci_time_init(void);
-       if (pcic_present()) {
+       if (pcic_present())
                pci_time_init();
-               return;
-       }
-#endif
-       sbus_time_init();
+       else
+               sbus_time_init();
 }