From: Dave Peterson Date: Sun, 26 Mar 2006 09:38:41 +0000 (-0800) Subject: [PATCH] EDAC: amd76x pci_dev_get/pci_dev_put fixes X-Git-Tag: v2.6.17-rc1~554 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=225159bd0a349bfd8cd9ae7c6bf39d75df09304a;p=linux-2.6 [PATCH] EDAC: amd76x pci_dev_get/pci_dev_put fixes Eliminate unnecessary calls to pci_dev_get() and pci_dev_put() from amd76x driver. Signed-off-by: David S. Peterson Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/edac/amd76x_edac.c b/drivers/edac/amd76x_edac.c index da171a56b6..6b7a441f04 100644 --- a/drivers/edac/amd76x_edac.c +++ b/drivers/edac/amd76x_edac.c @@ -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; @@ -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; } @@ -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); }