From: "Prakash, Sathya" <sathya.prakash@lsi.com>
To: linux-scsi@vger.kernel.org
Cc: eric.moore@lsi.com
Subject: [PATCH] mpt fusion: deregister from transport layer if PCI registration failed
Date: Mon, 2 Jul 2007 17:04:10 +0530 [thread overview]
Message-ID: <20070702113409.GB9231@lsil.com> (raw)
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;
}
reply other threads:[~2007-07-02 11:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070702113409.GB9231@lsil.com \
--to=sathya.prakash@lsi.com \
--cc=eric.moore@lsi.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.