Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39015
b: refs/heads/master
c: dedc993
h: refs/heads/master
i:
  39013: 9fb34bc
  39011: 4e9a5bf
  39007: 3eaee1d
v: v3
  • Loading branch information
Jon Mason authored and Andi Kleen committed Oct 5, 2006
1 parent 43e8c15 commit 9ba6926
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 814eadcefe79a2977a11ba135c4763a402112746
refs/heads/master: dedc9937e876cb5430bca6a1dccfcc2ff22f8b7c
12 changes: 7 additions & 5 deletions trunk/arch/x86_64/kernel/pci-calgary.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,8 @@ static int __init calgary_init_one(struct pci_dev *dev)
void __iomem *bbar;
int ret;

BUG_ON(dev->bus->number >= MAX_PHB_BUS_NUM);

address = locate_register_space(dev);
/* map entire 1MB of Calgary config space */
bbar = ioremap_nocache(address, 1024 * 1024);
Expand All @@ -842,10 +844,10 @@ static int __init calgary_init_one(struct pci_dev *dev)

static int __init calgary_init(void)
{
int i, ret = -ENODEV;
int ret = -ENODEV;
struct pci_dev *dev = NULL;

for (i = 0; i < MAX_PHB_BUS_NUM; i++) {
do {
dev = pci_get_device(PCI_VENDOR_ID_IBM,
PCI_DEVICE_ID_IBM_CALGARY,
dev);
Expand All @@ -861,12 +863,12 @@ static int __init calgary_init(void)
ret = calgary_init_one(dev);
if (ret)
goto error;
}
} while (1);

return ret;

error:
for (i--; i >= 0; i--) {
do {
dev = pci_find_device_reverse(PCI_VENDOR_ID_IBM,
PCI_DEVICE_ID_IBM_CALGARY,
dev);
Expand All @@ -882,7 +884,7 @@ static int __init calgary_init(void)
calgary_disable_translation(dev);
calgary_free_bus(dev);
pci_dev_put(dev); /* Undo calgary_init_one()'s pci_dev_get() */
}
} while (1);

return ret;
}
Expand Down

0 comments on commit 9ba6926

Please sign in to comment.