aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2011-04-17 07:49:55 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-20 01:11:39 -0400
commit06010fb588700e7fcb29e720c56884e3de5fd327 (patch)
tree832891d6ffcf8f2f762094c37b5e88a86bbdd007 /arch/sparc
parentdb1cdd146a0814b6f312fe1a7fa1ab87ac177b2a (diff)
sparc32: cleanup code for pci init
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>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/include/asm/pcic.h12
-rw-r--r--arch/sparc/kernel/irq_32.c9
-rw-r--r--arch/sparc/kernel/time_32.c10
3 files changed, 15 insertions, 16 deletions
diff --git a/arch/sparc/include/asm/pcic.h b/arch/sparc/include/asm/pcic.h
index f20ef562b265..7eb5d78f5211 100644
--- a/arch/sparc/include/asm/pcic.h
+++ b/arch/sparc/include/asm/pcic.h
@@ -29,11 +29,17 @@ struct linux_pcic {
29 int pcic_imdim; 29 int pcic_imdim;
30}; 30};
31 31
32extern int pcic_probe(void); 32#ifdef CONFIG_PCI
33/* Erm... MJ redefined pcibios_present() so that it does not work early. */
34extern int pcic_present(void); 33extern int pcic_present(void);
34extern int pcic_probe(void);
35extern void pci_time_init(void);
35extern void sun4m_pci_init_IRQ(void); 36extern void sun4m_pci_init_IRQ(void);
36 37#else
38static inline int pcic_present(void) { return 0; }
39static inline int pcic_probe(void) { return 0; }
40static inline void pci_time_init(void) {}
41static inline void sun4m_pci_init_IRQ(void) {}
42#endif
37#endif 43#endif
38 44
39/* Size of PCI I/O space which we relocate. */ 45/* Size of PCI I/O space which we relocate. */
diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c
index 7c93df4099cb..b2dbb4ba8608 100644
--- a/arch/sparc/kernel/irq_32.c
+++ b/arch/sparc/kernel/irq_32.c
@@ -607,14 +607,11 @@ void __init init_IRQ(void)
607 break; 607 break;
608 608
609 case sun4m: 609 case sun4m:
610#ifdef CONFIG_PCI
611 pcic_probe(); 610 pcic_probe();
612 if (pcic_present()) { 611 if (pcic_present())
613 sun4m_pci_init_IRQ(); 612 sun4m_pci_init_IRQ();
614 break; 613 else
615 } 614 sun4m_init_IRQ();
616#endif
617 sun4m_init_IRQ();
618 break; 615 break;
619 616
620 case sun4d: 617 case sun4d:
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c
index 4e236391b635..b61840300101 100644
--- a/arch/sparc/kernel/time_32.c
+++ b/arch/sparc/kernel/time_32.c
@@ -228,14 +228,10 @@ static void __init sbus_time_init(void)
228 228
229void __init time_init(void) 229void __init time_init(void)
230{ 230{
231#ifdef CONFIG_PCI 231 if (pcic_present())
232 extern void pci_time_init(void);
233 if (pcic_present()) {
234 pci_time_init(); 232 pci_time_init();
235 return; 233 else
236 } 234 sbus_time_init();
237#endif
238 sbus_time_init();
239} 235}
240 236
241 237