Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=57ce21bfccaf3b24296f1e097682177e49017a57
Commit:     57ce21bfccaf3b24296f1e097682177e49017a57
Parent:     0c8db6beb81a07147f64cffd33bd43b9e96f4f40
Author:     Prakash, Sathya <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 2 17:04:10 2007 +0530
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Wed Jul 18 11:17:18 2007 -0500

    [SCSI] mpt fusion: deregister from transport layer if PCI registration 
failed
    
    The mptspi and mptsas drivers are modified to deregister from transport 
layer
    if registration with PCI driver failed
    
    Signed-off-by: Sathya Prakash <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/message/fusion/mptsas.c |    8 +++++++-
 drivers/message/fusion/mptspi.c |    8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 030bb83..d506646 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -3301,6 +3301,8 @@ static struct pci_driver mptsas_driver = {
 static int __init
 mptsas_init(void)
 {
+       int error;
+
        show_mptmod_ver(my_NAME, my_VERSION);
 
        mptsas_transport_template =
@@ -3324,7 +3326,11 @@ mptsas_init(void)
                  ": Registered for IOC reset notifications\n"));
        }
 
-       return pci_register_driver(&mptsas_driver);
+       error = pci_register_driver(&mptsas_driver);
+       if (error)
+               sas_release_transport(mptsas_transport_template);
+
+       return error;
 }
 
 static void __exit
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 4d2c981..947fe29 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -1524,6 +1524,8 @@ static struct pci_driver mptspi_driver = {
 static int __init
 mptspi_init(void)
 {
+       int error;
+
        show_mptmod_ver(my_NAME, my_VERSION);
 
        mptspi_transport_template = 
spi_attach_transport(&mptspi_transport_functions);
@@ -1544,7 +1546,11 @@ mptspi_init(void)
                  ": Registered for IOC reset notifications\n"));
        }
 
-       return pci_register_driver(&mptspi_driver);
+       error = pci_register_driver(&mptspi_driver);
+       if (error)
+               spi_release_transport(mptspi_transport_template);
+
+       return error;
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to