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.a...@oracle.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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to