Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200774
b: refs/heads/master
c: 2d95d81
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Jul 2, 2010
1 parent 9757865 commit d607f05
Show file tree
Hide file tree
Showing 2 changed files with 13 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: bda142890e6bdd9b1115715e50b0276ea4b9978a
refs/heads/master: 2d95d8158b5ab51339f8482c98c01469c45ff6d7
17 changes: 12 additions & 5 deletions trunk/drivers/edac/i7core_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1947,21 +1947,26 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev,
* 0 for FOUND a device
* < 0 for error code
*/

static int probed = 0;

static int __devinit i7core_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{
int dev_idx = id->driver_data;
int rc;
struct i7core_dev *i7core_dev;

/* get the pci devices we want to reserve for our use */
mutex_lock(&i7core_edac_lock);

/*
* All memory controllers are allocated at the first pass.
*/
if (unlikely(dev_idx >= 1))
if (unlikely(probed >= 1)) {
mutex_unlock(&i7core_edac_lock);
return -EINVAL;

/* get the pci devices we want to reserve for our use */
mutex_lock(&i7core_edac_lock);
}
probed++;

rc = i7core_get_devices(pci_dev_table);
if (unlikely(rc < 0))
Expand Down Expand Up @@ -2033,6 +2038,8 @@ static void __devexit i7core_remove(struct pci_dev *pdev)
i7core_dev->socket);
}
}
probed--;

mutex_unlock(&i7core_edac_lock);
}

Expand Down

0 comments on commit d607f05

Please sign in to comment.