* [PATCH] mpt fusion: deregister from transport layer if PCI registration failed
@ 2007-07-02 11:34 Prakash, Sathya
0 siblings, 0 replies; only message in thread
From: Prakash, Sathya @ 2007-07-02 11:34 UTC (permalink / raw)
To: linux-scsi; +Cc: eric.moore
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>
----------------
diff -uarpN b/drivers/message/fusion/mptsas.c a/drivers/message/fusion/mptsas.c
--- b/drivers/message/fusion/mptsas.c 2007-07-02 16:20:46.000000000 +0530
+++ a/drivers/message/fusion/mptsas.c 2007-07-02 16:22:23.000000000 +0530
@@ -3237,6 +3237,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 =
@@ -3259,8 +3261,12 @@ mptsas_init(void)
dprintk((KERN_INFO MYNAM
": Registered for IOC reset notifications\n"));
}
+
+ error = pci_register_driver(&mptsas_driver);
+ if (error)
+ sas_release_transport(mptsas_transport_template);
- return pci_register_driver(&mptsas_driver);
+ return error;
}
static void __exit
diff -uarpN b/drivers/message/fusion/mptspi.c a/drivers/message/fusion/mptspi.c
--- b/drivers/message/fusion/mptspi.c 2007-07-02 16:20:46.000000000 +0530
+++ a/drivers/message/fusion/mptspi.c 2007-07-02 16:22:23.000000000 +0530
@@ -1521,6 +1521,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);
@@ -1541,7 +1543,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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-07-02 11:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-02 11:34 [PATCH] mpt fusion: deregister from transport layer if PCI registration failed Prakash, Sathya
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).