aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/pci-common.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 1037b3a093ee..88838b0f8b90 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1034,7 +1034,7 @@ clear_resource:
1034 } 1034 }
1035} 1035}
1036 1036
1037static inline void __devinit alloc_resource(struct pci_dev *dev, int idx) 1037static inline int __devinit alloc_resource(struct pci_dev *dev, int idx)
1038{ 1038{
1039 struct resource *pr, *r = &dev->resource[idx]; 1039 struct resource *pr, *r = &dev->resource[idx];
1040 1040
@@ -1058,7 +1058,10 @@ static inline void __devinit alloc_resource(struct pci_dev *dev, int idx)
1058 r->flags |= IORESOURCE_UNSET; 1058 r->flags |= IORESOURCE_UNSET;
1059 r->end -= r->start; 1059 r->end -= r->start;
1060 r->start = 0; 1060 r->start = 0;
1061
1062 return -EBUSY;
1061 } 1063 }
1064 return 0;
1062} 1065}
1063 1066
1064static void __init pcibios_allocate_resources(int pass) 1067static void __init pcibios_allocate_resources(int pass)
@@ -1080,8 +1083,12 @@ static void __init pcibios_allocate_resources(int pass)
1080 disabled = !(command & PCI_COMMAND_IO); 1083 disabled = !(command & PCI_COMMAND_IO);
1081 else 1084 else
1082 disabled = !(command & PCI_COMMAND_MEMORY); 1085 disabled = !(command & PCI_COMMAND_MEMORY);
1083 if (pass == disabled) 1086 if (pass == disabled && alloc_resource(dev, idx)) {
1084 alloc_resource(dev, idx); 1087 command &= ~(r->flags & (IORESOURCE_IO |
1088 IORESOURCE_MEM));
1089 pci_write_config_word(dev,
1090 PCI_COMMAND, command);
1091 }
1085 } 1092 }
1086 if (pass) 1093 if (pass)
1087 continue; 1094 continue;