aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message
diff options
context:
space:
mode:
authorPrakash, Sathya <sathya.prakash@lsi.com>2007-07-02 07:34:10 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-07-18 12:17:18 -0400
commit57ce21bfccaf3b24296f1e097682177e49017a57 (patch)
tree256367708553f6d32c4b2fa84e406f69e5b8b2a4 /drivers/message
parent0c8db6beb81a07147f64cffd33bd43b9e96f4f40 (diff)
[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 <sathya.prakash@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message')
-rw-r--r--drivers/message/fusion/mptsas.c8
-rw-r--r--drivers/message/fusion/mptspi.c8
2 files changed, 14 insertions, 2 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 030bb8389aee..d50664640512 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -3301,6 +3301,8 @@ static struct pci_driver mptsas_driver = {
3301static int __init 3301static int __init
3302mptsas_init(void) 3302mptsas_init(void)
3303{ 3303{
3304 int error;
3305
3304 show_mptmod_ver(my_NAME, my_VERSION); 3306 show_mptmod_ver(my_NAME, my_VERSION);
3305 3307
3306 mptsas_transport_template = 3308 mptsas_transport_template =
@@ -3324,7 +3326,11 @@ mptsas_init(void)
3324 ": Registered for IOC reset notifications\n")); 3326 ": Registered for IOC reset notifications\n"));
3325 } 3327 }
3326 3328
3327 return pci_register_driver(&mptsas_driver); 3329 error = pci_register_driver(&mptsas_driver);
3330 if (error)
3331 sas_release_transport(mptsas_transport_template);
3332
3333 return error;
3328} 3334}
3329 3335
3330static void __exit 3336static void __exit
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 4d2c98104aeb..947fe2901800 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -1524,6 +1524,8 @@ static struct pci_driver mptspi_driver = {
1524static int __init 1524static int __init
1525mptspi_init(void) 1525mptspi_init(void)
1526{ 1526{
1527 int error;
1528
1527 show_mptmod_ver(my_NAME, my_VERSION); 1529 show_mptmod_ver(my_NAME, my_VERSION);
1528 1530
1529 mptspi_transport_template = spi_attach_transport(&mptspi_transport_functions); 1531 mptspi_transport_template = spi_attach_transport(&mptspi_transport_functions);
@@ -1544,7 +1546,11 @@ mptspi_init(void)
1544 ": Registered for IOC reset notifications\n")); 1546 ": Registered for IOC reset notifications\n"));
1545 } 1547 }
1546 1548
1547 return pci_register_driver(&mptspi_driver); 1549 error = pci_register_driver(&mptspi_driver);
1550 if (error)
1551 spi_release_transport(mptspi_transport_template);
1552
1553 return error;
1548} 1554}
1549 1555
1550/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1556/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/