Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34120
b: refs/heads/master
c: af52559
h: refs/heads/master
v: v3
  • Loading branch information
Linas Vepstas authored and Paul Mackerras committed Sep 21, 2006
1 parent 5f5d45f commit 602b59e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 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: 4dbefe6459555d6fb9d08743615fbaa53894beb2
refs/heads/master: af525592187951a595c73de11b48969a13b5d5a3
17 changes: 2 additions & 15 deletions trunk/arch/powerpc/platforms/pseries/eeh_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ pci_addr_cache_insert(struct pci_dev *dev, unsigned long alo,
if (!piar)
return NULL;

pci_dev_get(dev);
piar->addr_lo = alo;
piar->addr_hi = ahi;
piar->pcidev = dev;
Expand All @@ -178,7 +179,6 @@ static void __pci_addr_cache_insert_device(struct pci_dev *dev)
struct device_node *dn;
struct pci_dn *pdn;
int i;
int inserted = 0;

dn = pci_device_to_OF_node(dev);
if (!dn) {
Expand All @@ -197,9 +197,6 @@ static void __pci_addr_cache_insert_device(struct pci_dev *dev)
return;
}

/* The cache holds a reference to the device... */
pci_dev_get(dev);

/* Walk resources on this device, poke them into the tree */
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
unsigned long start = pci_resource_start(dev,i);
Expand All @@ -212,12 +209,7 @@ static void __pci_addr_cache_insert_device(struct pci_dev *dev)
if (start == 0 || ~start == 0 || end == 0 || ~end == 0)
continue;
pci_addr_cache_insert(dev, start, end, flags);
inserted = 1;
}

/* If there was nothing to add, the cache has no reference... */
if (!inserted)
pci_dev_put(dev);
}

/**
Expand All @@ -240,7 +232,6 @@ void pci_addr_cache_insert_device(struct pci_dev *dev)
static inline void __pci_addr_cache_remove_device(struct pci_dev *dev)
{
struct rb_node *n;
int removed = 0;

restart:
n = rb_first(&pci_io_addr_cache_root.rb_root);
Expand All @@ -250,16 +241,12 @@ static inline void __pci_addr_cache_remove_device(struct pci_dev *dev)

if (piar->pcidev == dev) {
rb_erase(n, &pci_io_addr_cache_root.rb_root);
removed = 1;
pci_dev_put(piar->pcidev);
kfree(piar);
goto restart;
}
n = rb_next(n);
}

/* The cache no longer holds its reference to this device... */
if (removed)
pci_dev_put(dev);
}

/**
Expand Down

0 comments on commit 602b59e

Please sign in to comment.