Skip to content

Commit

Permalink
[PATCH] EDAC: amd76x pci_dev_get/pci_dev_put fixes
Browse files Browse the repository at this point in the history
Eliminate unnecessary calls to pci_dev_get() and pci_dev_put() from
amd76x driver.

Signed-off-by: David S. Peterson <dsp@llnl.gov>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Dave Peterson authored and Linus Torvalds committed Mar 26, 2006
1 parent 680cbbb commit 225159b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/edac/amd76x_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)

debugf0("%s(): mci = %p\n", __func__, mci);

mci->pdev = pci_dev_get(pdev);
mci->pdev = pdev;
mci->mtype_cap = MEM_FLAG_RDDR;

mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED;
Expand Down Expand Up @@ -284,11 +284,8 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
return 0;

fail:
if (mci) {
if(mci->pdev)
pci_dev_put(mci->pdev);
if (mci != NULL)
edac_mc_free(mci);
}
return rc;
}

Expand Down Expand Up @@ -322,7 +319,6 @@ static void __devexit amd76x_remove_one(struct pci_dev *pdev)
return;
if (edac_mc_del_mc(mci))
return;
pci_dev_put(mci->pdev);
edac_mc_free(mci);
}

Expand Down

0 comments on commit 225159b

Please sign in to comment.