diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-03-11 02:46:14 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-04-16 03:00:12 -0400 |
commit | d0e3db40e2a1352aa2a2f425a7d4631bddc03d51 (patch) | |
tree | 275392db569a7f3808d8f86cfcb4874bfe81f997 /arch/sh/drivers/pci/pci.c | |
parent | b8b47bfbe4eb1ae0e6891e49c86a5f4fb00413be (diff) |
sh: add init member to pci_channel data
This patch adds an init callback to struct pci_channel and makes sure
it is initialized properly. Code is added to call this init function
from pcibios_init(). Return values are adjusted and a warning is is
printed if init fails.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers/pci/pci.c')
-rw-r--r-- | arch/sh/drivers/pci/pci.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index 0d6ac7a1db49..29ec16e69afa 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c | |||
@@ -28,18 +28,31 @@ static int __init pcibios_init(void) | |||
28 | struct pci_bus *bus; | 28 | struct pci_bus *bus; |
29 | int busno; | 29 | int busno; |
30 | 30 | ||
31 | /* init channels */ | ||
32 | busno = 0; | ||
33 | for (p = board_pci_channels; p->init; p++) { | ||
34 | if (p->init(p) == 0) | ||
35 | p->enabled = 1; | ||
36 | else | ||
37 | pr_err("Unable to init pci channel %d\n", busno); | ||
38 | busno++; | ||
39 | } | ||
40 | |||
31 | #ifdef CONFIG_PCI_AUTO | 41 | #ifdef CONFIG_PCI_AUTO |
32 | /* assign resources */ | 42 | /* assign resources */ |
33 | busno = 0; | 43 | busno = 0; |
34 | for (p = board_pci_channels; p->pci_ops != NULL; p++) | 44 | for (p = board_pci_channels; p->init; p++) |
35 | busno = pciauto_assign_resources(busno, p) + 1; | 45 | if (p->enabled) |
46 | busno = pciauto_assign_resources(busno, p) + 1; | ||
36 | #endif | 47 | #endif |
37 | 48 | ||
38 | /* scan the buses */ | 49 | /* scan the buses */ |
39 | busno = 0; | 50 | busno = 0; |
40 | for (p = board_pci_channels; p->pci_ops != NULL; p++) { | 51 | for (p = board_pci_channels; p->init; p++) { |
41 | bus = pci_scan_bus(busno, p->pci_ops, p); | 52 | if (p->enabled) { |
42 | busno = bus->subordinate + 1; | 53 | bus = pci_scan_bus(busno, p->pci_ops, p); |
54 | busno = bus->subordinate + 1; | ||
55 | } | ||
43 | } | 56 | } |
44 | 57 | ||
45 | pci_fixup_irqs(pci_common_swizzle, pcibios_map_platform_irq); | 58 | pci_fixup_irqs(pci_common_swizzle, pcibios_map_platform_irq); |