[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1364595238.26110.3.camel@concerto>
Date: Fri, 29 Mar 2013 16:13:58 -0600
From: Khalid Aziz <khalid.aziz@...cle.com>
To: mchehab@...hat.com, dougthompson@...ssion.com
Cc: linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
khalid@...ehiking.org
Subject: [PATCH] Avoid unnecessary calls to sandybridge mce decoder on
incompatible platform
Add MCE decoder to MCE decode chain in probe routine instead
of in init routine so that handler is not called unless the
driver is indeed running on SandyBridge.
Signed-off-by: Khalid Aziz <khalid.aziz@...cle.com>
---
drivers/edac/sb_edac.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index 57244f9..6f05ffd 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -1724,6 +1724,7 @@ static int sbridge_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto fail1;
}
+ mce_register_decode_chain(&sbridge_mce_dec);
sbridge_printk(KERN_INFO, "Driver loaded.\n");
mutex_unlock(&sbridge_edac_lock);
@@ -1803,10 +1804,8 @@ static int __init sbridge_init(void)
pci_rc = pci_register_driver(&sbridge_driver);
- if (pci_rc >= 0) {
- mce_register_decode_chain(&sbridge_mce_dec);
+ if (pci_rc >= 0)
return 0;
- }
sbridge_printk(KERN_ERR, "Failed to register device with error %d.\n",
pci_rc);
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists