Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 804

kernel-2.6.18-238.el5.src.rpm

From: Mauro Carvalho Chehab <mchehab@redhat.com>
Date: Tue, 23 Nov 2010 17:34:08 -0500
Subject: [edac] i7core_edac: return -ENODEV if dev already probed
Message-id: <20101123153408.48f9f68c@pedra>
Patchwork-id: 29585
O-Subject: [PATCH RHEL5 29/29] BZ#:651869 i7core_edac: return -ENODEV when
	devices were already probed
Bugzilla: 651869
RH-Acked-by: Aristeu Rozanski <aris@redhat.com>

Changeset: 76a7bd81130646459dfded1845e0d511488a6afa

Due to the nature of i7core, we need to probe and attach all PCI
devices used by this driver during the first time probe is called.
However, PCI core will call the probe routine one time for each CPU
socket. If we return -EINVAL to those calls, it would seem that the
driver fails, when, in fact, there's no more devices left to initialize.

Changing the return code to -ENODEV solves this issue.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>

diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index f8642c8..37ee765 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -2034,7 +2034,7 @@ static int __devinit i7core_probe(struct pci_dev *pdev,
 	 */
 	if (unlikely(probed >= 1)) {
 		mutex_unlock(&i7core_edac_lock);
-		return -EINVAL;
+		return -ENODEV;
 	}
 	probed++;