Commit 06010fb5 authored by Sam Ravnborg's avatar Sam Ravnborg Committed by David S. Miller

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: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent db1cdd14
...@@ -29,11 +29,17 @@ struct linux_pcic { ...@@ -29,11 +29,17 @@ struct linux_pcic {
int pcic_imdim; int pcic_imdim;
}; };
extern int pcic_probe(void); #ifdef CONFIG_PCI
/* Erm... MJ redefined pcibios_present() so that it does not work early. */
extern int pcic_present(void); extern int pcic_present(void);
extern int pcic_probe(void);
extern void pci_time_init(void);
extern void sun4m_pci_init_IRQ(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 #endif
/* Size of PCI I/O space which we relocate. */ /* Size of PCI I/O space which we relocate. */
......
...@@ -607,13 +607,10 @@ void __init init_IRQ(void) ...@@ -607,13 +607,10 @@ void __init init_IRQ(void)
break; break;
case sun4m: case sun4m:
#ifdef CONFIG_PCI
pcic_probe(); pcic_probe();
if (pcic_present()) { if (pcic_present())
sun4m_pci_init_IRQ(); sun4m_pci_init_IRQ();
break; else
}
#endif
sun4m_init_IRQ(); sun4m_init_IRQ();
break; break;
......
...@@ -228,13 +228,9 @@ static void __init sbus_time_init(void) ...@@ -228,13 +228,9 @@ static void __init sbus_time_init(void)
void __init time_init(void) void __init time_init(void)
{ {
#ifdef CONFIG_PCI if (pcic_present())
extern void pci_time_init(void);
if (pcic_present()) {
pci_time_init(); pci_time_init();
return; else
}
#endif
sbus_time_init(); sbus_time_init();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment