diff options
| author | Jia Hongtao <B38951@freescale.com> | 2012-08-03 06:14:09 -0400 |
|---|---|---|
| committer | Kumar Gala <galak@kernel.crashing.org> | 2012-08-03 09:25:52 -0400 |
| commit | c9f11c30374329a0d2a88cf05281ca49d8eca9ab (patch) | |
| tree | f0d18ba0e1f589ef8e7c70689fe25848867310ca | |
| parent | 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff) | |
powerpc/fsl-pci: Only scan PCI bus if configured as a host
We change fsl_add_bridge to return -ENODEV if the controller is working in
agent mode. Then check the return value of fsl_add_bridge to guarantee
that only successfully added host bus will be scanned.
Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
| -rw-r--r-- | arch/powerpc/sysdev/fsl_pci.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index a7b2a600d0a4..c37f46136321 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
| @@ -465,7 +465,7 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary) | |||
| 465 | iounmap(hose->cfg_data); | 465 | iounmap(hose->cfg_data); |
| 466 | iounmap(hose->cfg_addr); | 466 | iounmap(hose->cfg_addr); |
| 467 | pcibios_free_controller(hose); | 467 | pcibios_free_controller(hose); |
| 468 | return 0; | 468 | return -ENODEV; |
| 469 | } | 469 | } |
| 470 | 470 | ||
| 471 | setup_pci_cmd(hose); | 471 | setup_pci_cmd(hose); |
| @@ -827,6 +827,7 @@ struct device_node *fsl_pci_primary; | |||
| 827 | 827 | ||
| 828 | void __devinit fsl_pci_init(void) | 828 | void __devinit fsl_pci_init(void) |
| 829 | { | 829 | { |
| 830 | int ret; | ||
| 830 | struct device_node *node; | 831 | struct device_node *node; |
| 831 | struct pci_controller *hose; | 832 | struct pci_controller *hose; |
| 832 | dma_addr_t max = 0xffffffff; | 833 | dma_addr_t max = 0xffffffff; |
| @@ -855,10 +856,12 @@ void __devinit fsl_pci_init(void) | |||
| 855 | if (!fsl_pci_primary) | 856 | if (!fsl_pci_primary) |
| 856 | fsl_pci_primary = node; | 857 | fsl_pci_primary = node; |
| 857 | 858 | ||
| 858 | fsl_add_bridge(node, fsl_pci_primary == node); | 859 | ret = fsl_add_bridge(node, fsl_pci_primary == node); |
| 859 | hose = pci_find_hose_for_OF_device(node); | 860 | if (ret == 0) { |
| 860 | max = min(max, hose->dma_window_base_cur + | 861 | hose = pci_find_hose_for_OF_device(node); |
| 861 | hose->dma_window_size); | 862 | max = min(max, hose->dma_window_base_cur + |
| 863 | hose->dma_window_size); | ||
| 864 | } | ||
| 862 | } | 865 | } |
| 863 | } | 866 | } |
| 864 | 867 | ||
