[SCSI] mptfusion - cleaning up xxx_probe error handling
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>
This commit is contained in:
committed by
James Bottomley
parent
f78496da6a
commit
7acec1e755
@@ -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;
|
||||
|
Reference in New Issue
Block a user