Skip to content

Commit 06010fb

Browse files
sravnborgdavem330
authored andcommitted
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>
1 parent db1cdd1 commit 06010fb

3 files changed

Lines changed: 15 additions & 16 deletions

File tree

‎arch/sparc/include/asm/pcic.h‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,17 @@ struct linux_pcic {
2929
int pcic_imdim;
3030
};
3131

32-
extern int pcic_probe(void);
33-
/* Erm... MJ redefined pcibios_present() so that it does not work early. */
32+
#ifdef CONFIG_PCI
3433
extern int pcic_present(void);
34+
extern int pcic_probe(void);
35+
extern void pci_time_init(void);
3536
extern void sun4m_pci_init_IRQ(void);
36-
37+
#else
38+
static inline int pcic_present(void) { return 0; }
39+
static inline int pcic_probe(void) { return 0; }
40+
static inline void pci_time_init(void) {}
41+
static inline void sun4m_pci_init_IRQ(void) {}
42+
#endif
3743
#endif
3844

3945
/* Size of PCI I/O space which we relocate. */

‎arch/sparc/kernel/irq_32.c‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -607,14 +607,11 @@ void __init init_IRQ(void)
607607
break;
608608

609609
case sun4m:
610-
#ifdef CONFIG_PCI
611610
pcic_probe();
612-
if (pcic_present()) {
611+
if (pcic_present())
613612
sun4m_pci_init_IRQ();
614-
break;
615-
}
616-
#endif
617-
sun4m_init_IRQ();
613+
else
614+
sun4m_init_IRQ();
618615
break;
619616

620617
case sun4d:

‎arch/sparc/kernel/time_32.c‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,10 @@ static void __init sbus_time_init(void)
228228

229229
void __init time_init(void)
230230
{
231-
#ifdef CONFIG_PCI
232-
extern void pci_time_init(void);
233-
if (pcic_present()) {
231+
if (pcic_present())
234232
pci_time_init();
235-
return;
236-
}
237-
#endif
238-
sbus_time_init();
233+
else
234+
sbus_time_init();
239235
}
240236

241237

0 commit comments

Comments
 (0)