[SCSI] mptfusion - cleaning up xxx_probe error handling
authorMoore, Eric Dean <Eric.Moore@lsil.com>
Thu, 17 Nov 2005 01:54:17 +0000 (18:54 -0700)
committerJames Bottomley <jejb@mulgrave.(none)>
Wed, 14 Dec 2005 01:38:44 +0000 (18:38 -0700)
This cleans the returning failure conditions of the
mptsas/mptfc/mptspi probe routines.

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/message/fusion/mptfc.c
drivers/message/fusion/mptsas.c
drivers/message/fusion/mptspi.c

index 101993f2133345393cc8eb52745247c9fc9ffb04..531664f9e33940243dc66389e30f5edcb3f68642 100644 (file)
@@ -168,13 +168,15 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                printk(MYIOC_s_WARN_FMT
                  "Skipping because it's not operational!\n",
                  ioc->name);
-               return -ENODEV;
+               error = -ENODEV;
+               goto out_mptfc_probe;
        }
 
        if (!ioc->active) {
                printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n",
                  ioc->name);
-               return -ENODEV;
+               error = -ENODEV;
+               goto out_mptfc_probe;
        }
 
        /*  Sanity check - ensure at least 1 port is INITIATOR capable
@@ -199,7 +201,8 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                printk(MYIOC_s_WARN_FMT
                        "Unable to register controller with SCSI subsystem\n",
                        ioc->name);
-                return -1;
+               error = -1;
+               goto out_mptfc_probe;
         }
 
        spin_lock_irqsave(&ioc->FreeQlock, flags);
@@ -267,7 +270,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        mem = kmalloc(sz, GFP_ATOMIC);
        if (mem == NULL) {
                error = -ENOMEM;
-               goto mptfc_probe_failed;
+               goto out_mptfc_probe;
        }
 
        memset(mem, 0, sz);
@@ -285,7 +288,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        mem = kmalloc(sz, GFP_ATOMIC);
        if (mem == NULL) {
                error = -ENOMEM;
-               goto mptfc_probe_failed;
+               goto out_mptfc_probe;
        }
 
        memset(mem, 0, sz);
@@ -331,13 +334,13 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        if(error) {
                dprintk((KERN_ERR MYNAM
                  "scsi_add_host failed\n"));
-               goto mptfc_probe_failed;
+               goto out_mptfc_probe;
        }
 
        scsi_scan_host(sh);
        return 0;
 
-mptfc_probe_failed:
+out_mptfc_probe:
 
        mptscsih_remove(pdev);
        return error;
index 0e557a3a9d0627e97f7c6f44e3ee3c9a145c313b..282fb5ebbadfc67e8ad1d0c72227190a749f9d98 100644 (file)
@@ -1134,13 +1134,15 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                printk(MYIOC_s_WARN_FMT
                  "Skipping because it's not operational!\n",
                  ioc->name);
-               return -ENODEV;
+               error = -ENODEV;
+               goto out_mptsas_probe;
        }
 
        if (!ioc->active) {
                printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n",
                  ioc->name);
-               return -ENODEV;
+               error = -ENODEV;
+               goto out_mptsas_probe;
        }
 
        /*  Sanity check - ensure at least 1 port is INITIATOR capable
@@ -1164,7 +1166,8 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                printk(MYIOC_s_WARN_FMT
                        "Unable to register controller with SCSI subsystem\n",
                        ioc->name);
-                return -1;
+               error = -1;
+               goto out_mptsas_probe;
         }
 
        spin_lock_irqsave(&ioc->FreeQlock, flags);
@@ -1238,7 +1241,7 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        mem = kmalloc(sz, GFP_ATOMIC);
        if (mem == NULL) {
                error = -ENOMEM;
-               goto mptsas_probe_failed;
+               goto out_mptsas_probe;
        }
 
        memset(mem, 0, sz);
@@ -1256,7 +1259,7 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        mem = kmalloc(sz, GFP_ATOMIC);
        if (mem == NULL) {
                error = -ENOMEM;
-               goto mptsas_probe_failed;
+               goto out_mptsas_probe;
        }
 
        memset(mem, 0, sz);
@@ -1309,14 +1312,14 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        if (error) {
                dprintk((KERN_ERR MYNAM
                  "scsi_add_host failed\n"));
-               goto mptsas_probe_failed;
+               goto out_mptsas_probe;
        }
 
        mptsas_scan_sas_topology(ioc);
 
        return 0;
 
-mptsas_probe_failed:
+out_mptsas_probe:
 
        mptscsih_remove(pdev);
        return error;
index 9431d386c72abbd6d5d848b7e5cbcbb622bb1fd5..91bc467477efaa7bd53cd442e4d39c4794b029af 100644 (file)
@@ -178,13 +178,15 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                printk(MYIOC_s_WARN_FMT
                  "Skipping because it's not operational!\n",
                  ioc->name);
-               return -ENODEV;
+               error = -ENODEV;
+               goto out_mptspi_probe;
        }
 
        if (!ioc->active) {
                printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n",
                  ioc->name);
-               return -ENODEV;
+               error = -ENODEV;
+               goto out_mptspi_probe;
        }
 
        /*  Sanity check - ensure at least 1 port is INITIATOR capable
@@ -209,7 +211,8 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                printk(MYIOC_s_WARN_FMT
                        "Unable to register controller with SCSI subsystem\n",
                        ioc->name);
-                return -1;
+               error = -1;
+               goto out_mptspi_probe;
         }
 
        spin_lock_irqsave(&ioc->FreeQlock, flags);
@@ -287,7 +290,7 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        mem = kmalloc(sz, GFP_ATOMIC);
        if (mem == NULL) {
                error = -ENOMEM;
-               goto mptspi_probe_failed;
+               goto out_mptspi_probe;
        }
 
        memset(mem, 0, sz);
@@ -305,7 +308,7 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        mem = kmalloc(sz, GFP_ATOMIC);
        if (mem == NULL) {
                error = -ENOMEM;
-               goto mptspi_probe_failed;
+               goto out_mptspi_probe;
        }
 
        memset(mem, 0, sz);
@@ -386,13 +389,13 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        if(error) {
                dprintk((KERN_ERR MYNAM
                  "scsi_add_host failed\n"));
-               goto mptspi_probe_failed;
+               goto out_mptspi_probe;
        }
 
        scsi_scan_host(sh);
        return 0;
 
-mptspi_probe_failed:
+out_mptspi_probe:
 
        mptscsih_remove(pdev);
        return error;