提交 57ce21bf 编写于 作者: P Prakash, Sathya 提交者: James Bottomley

[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: NSathya Prakash <sathya.prakash@lsi.com>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 0c8db6be
...@@ -3301,6 +3301,8 @@ static struct pci_driver mptsas_driver = { ...@@ -3301,6 +3301,8 @@ static struct pci_driver mptsas_driver = {
static int __init static int __init
mptsas_init(void) mptsas_init(void)
{ {
int error;
show_mptmod_ver(my_NAME, my_VERSION); show_mptmod_ver(my_NAME, my_VERSION);
mptsas_transport_template = mptsas_transport_template =
...@@ -3324,7 +3326,11 @@ mptsas_init(void) ...@@ -3324,7 +3326,11 @@ mptsas_init(void)
": Registered for IOC reset notifications\n")); ": 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 static void __exit
......
...@@ -1524,6 +1524,8 @@ static struct pci_driver mptspi_driver = { ...@@ -1524,6 +1524,8 @@ static struct pci_driver mptspi_driver = {
static int __init static int __init
mptspi_init(void) mptspi_init(void)
{ {
int error;
show_mptmod_ver(my_NAME, my_VERSION); show_mptmod_ver(my_NAME, my_VERSION);
mptspi_transport_template = spi_attach_transport(&mptspi_transport_functions); mptspi_transport_template = spi_attach_transport(&mptspi_transport_functions);
...@@ -1544,7 +1546,11 @@ mptspi_init(void) ...@@ -1544,7 +1546,11 @@ mptspi_init(void)
": Registered for IOC reset notifications\n")); ": 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;
} }
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册