diff options
author | Moore, Eric Dean <Eric.Moore@lsil.com> | 2005-11-16 20:54:17 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-12-13 20:38:44 -0500 |
commit | 7acec1e7556a861416bb6b10f3e3cbb6e82fc01d (patch) | |
tree | 3ca770f11ae152cd17af2a2032f2b13d0370d114 | |
parent | f78496da6a85f4b5f4532d7bf85b05fa655146a8 (diff) |
[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>
-rw-r--r-- | drivers/message/fusion/mptfc.c | 17 | ||||
-rw-r--r-- | drivers/message/fusion/mptsas.c | 17 | ||||
-rw-r--r-- | drivers/message/fusion/mptspi.c | 17 |
3 files changed, 30 insertions, 21 deletions
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index 101993f21333..531664f9e339 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c | |||
@@ -168,13 +168,15 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
168 | printk(MYIOC_s_WARN_FMT | 168 | printk(MYIOC_s_WARN_FMT |
169 | "Skipping because it's not operational!\n", | 169 | "Skipping because it's not operational!\n", |
170 | ioc->name); | 170 | ioc->name); |
171 | return -ENODEV; | 171 | error = -ENODEV; |
172 | goto out_mptfc_probe; | ||
172 | } | 173 | } |
173 | 174 | ||
174 | if (!ioc->active) { | 175 | if (!ioc->active) { |
175 | printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n", | 176 | printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n", |
176 | ioc->name); | 177 | ioc->name); |
177 | return -ENODEV; | 178 | error = -ENODEV; |
179 | goto out_mptfc_probe; | ||
178 | } | 180 | } |
179 | 181 | ||
180 | /* Sanity check - ensure at least 1 port is INITIATOR capable | 182 | /* 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) | |||
199 | printk(MYIOC_s_WARN_FMT | 201 | printk(MYIOC_s_WARN_FMT |
200 | "Unable to register controller with SCSI subsystem\n", | 202 | "Unable to register controller with SCSI subsystem\n", |
201 | ioc->name); | 203 | ioc->name); |
202 | return -1; | 204 | error = -1; |
205 | goto out_mptfc_probe; | ||
203 | } | 206 | } |
204 | 207 | ||
205 | spin_lock_irqsave(&ioc->FreeQlock, flags); | 208 | spin_lock_irqsave(&ioc->FreeQlock, flags); |
@@ -267,7 +270,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
267 | mem = kmalloc(sz, GFP_ATOMIC); | 270 | mem = kmalloc(sz, GFP_ATOMIC); |
268 | if (mem == NULL) { | 271 | if (mem == NULL) { |
269 | error = -ENOMEM; | 272 | error = -ENOMEM; |
270 | goto mptfc_probe_failed; | 273 | goto out_mptfc_probe; |
271 | } | 274 | } |
272 | 275 | ||
273 | memset(mem, 0, sz); | 276 | memset(mem, 0, sz); |
@@ -285,7 +288,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
285 | mem = kmalloc(sz, GFP_ATOMIC); | 288 | mem = kmalloc(sz, GFP_ATOMIC); |
286 | if (mem == NULL) { | 289 | if (mem == NULL) { |
287 | error = -ENOMEM; | 290 | error = -ENOMEM; |
288 | goto mptfc_probe_failed; | 291 | goto out_mptfc_probe; |
289 | } | 292 | } |
290 | 293 | ||
291 | memset(mem, 0, sz); | 294 | memset(mem, 0, sz); |
@@ -331,13 +334,13 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
331 | if(error) { | 334 | if(error) { |
332 | dprintk((KERN_ERR MYNAM | 335 | dprintk((KERN_ERR MYNAM |
333 | "scsi_add_host failed\n")); | 336 | "scsi_add_host failed\n")); |
334 | goto mptfc_probe_failed; | 337 | goto out_mptfc_probe; |
335 | } | 338 | } |
336 | 339 | ||
337 | scsi_scan_host(sh); | 340 | scsi_scan_host(sh); |
338 | return 0; | 341 | return 0; |
339 | 342 | ||
340 | mptfc_probe_failed: | 343 | out_mptfc_probe: |
341 | 344 | ||
342 | mptscsih_remove(pdev); | 345 | mptscsih_remove(pdev); |
343 | return error; | 346 | return error; |
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 0e557a3a9d06..282fb5ebbadf 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -1134,13 +1134,15 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1134 | printk(MYIOC_s_WARN_FMT | 1134 | printk(MYIOC_s_WARN_FMT |
1135 | "Skipping because it's not operational!\n", | 1135 | "Skipping because it's not operational!\n", |
1136 | ioc->name); | 1136 | ioc->name); |
1137 | return -ENODEV; | 1137 | error = -ENODEV; |
1138 | goto out_mptsas_probe; | ||
1138 | } | 1139 | } |
1139 | 1140 | ||
1140 | if (!ioc->active) { | 1141 | if (!ioc->active) { |
1141 | printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n", | 1142 | printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n", |
1142 | ioc->name); | 1143 | ioc->name); |
1143 | return -ENODEV; | 1144 | error = -ENODEV; |
1145 | goto out_mptsas_probe; | ||
1144 | } | 1146 | } |
1145 | 1147 | ||
1146 | /* Sanity check - ensure at least 1 port is INITIATOR capable | 1148 | /* 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) | |||
1164 | printk(MYIOC_s_WARN_FMT | 1166 | printk(MYIOC_s_WARN_FMT |
1165 | "Unable to register controller with SCSI subsystem\n", | 1167 | "Unable to register controller with SCSI subsystem\n", |
1166 | ioc->name); | 1168 | ioc->name); |
1167 | return -1; | 1169 | error = -1; |
1170 | goto out_mptsas_probe; | ||
1168 | } | 1171 | } |
1169 | 1172 | ||
1170 | spin_lock_irqsave(&ioc->FreeQlock, flags); | 1173 | spin_lock_irqsave(&ioc->FreeQlock, flags); |
@@ -1238,7 +1241,7 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1238 | mem = kmalloc(sz, GFP_ATOMIC); | 1241 | mem = kmalloc(sz, GFP_ATOMIC); |
1239 | if (mem == NULL) { | 1242 | if (mem == NULL) { |
1240 | error = -ENOMEM; | 1243 | error = -ENOMEM; |
1241 | goto mptsas_probe_failed; | 1244 | goto out_mptsas_probe; |
1242 | } | 1245 | } |
1243 | 1246 | ||
1244 | memset(mem, 0, sz); | 1247 | memset(mem, 0, sz); |
@@ -1256,7 +1259,7 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1256 | mem = kmalloc(sz, GFP_ATOMIC); | 1259 | mem = kmalloc(sz, GFP_ATOMIC); |
1257 | if (mem == NULL) { | 1260 | if (mem == NULL) { |
1258 | error = -ENOMEM; | 1261 | error = -ENOMEM; |
1259 | goto mptsas_probe_failed; | 1262 | goto out_mptsas_probe; |
1260 | } | 1263 | } |
1261 | 1264 | ||
1262 | memset(mem, 0, sz); | 1265 | memset(mem, 0, sz); |
@@ -1309,14 +1312,14 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1309 | if (error) { | 1312 | if (error) { |
1310 | dprintk((KERN_ERR MYNAM | 1313 | dprintk((KERN_ERR MYNAM |
1311 | "scsi_add_host failed\n")); | 1314 | "scsi_add_host failed\n")); |
1312 | goto mptsas_probe_failed; | 1315 | goto out_mptsas_probe; |
1313 | } | 1316 | } |
1314 | 1317 | ||
1315 | mptsas_scan_sas_topology(ioc); | 1318 | mptsas_scan_sas_topology(ioc); |
1316 | 1319 | ||
1317 | return 0; | 1320 | return 0; |
1318 | 1321 | ||
1319 | mptsas_probe_failed: | 1322 | out_mptsas_probe: |
1320 | 1323 | ||
1321 | mptscsih_remove(pdev); | 1324 | mptscsih_remove(pdev); |
1322 | return error; | 1325 | return error; |
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 9431d386c72a..91bc467477ef 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c | |||
@@ -178,13 +178,15 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
178 | printk(MYIOC_s_WARN_FMT | 178 | printk(MYIOC_s_WARN_FMT |
179 | "Skipping because it's not operational!\n", | 179 | "Skipping because it's not operational!\n", |
180 | ioc->name); | 180 | ioc->name); |
181 | return -ENODEV; | 181 | error = -ENODEV; |
182 | goto out_mptspi_probe; | ||
182 | } | 183 | } |
183 | 184 | ||
184 | if (!ioc->active) { | 185 | if (!ioc->active) { |
185 | printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n", | 186 | printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n", |
186 | ioc->name); | 187 | ioc->name); |
187 | return -ENODEV; | 188 | error = -ENODEV; |
189 | goto out_mptspi_probe; | ||
188 | } | 190 | } |
189 | 191 | ||
190 | /* Sanity check - ensure at least 1 port is INITIATOR capable | 192 | /* 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) | |||
209 | printk(MYIOC_s_WARN_FMT | 211 | printk(MYIOC_s_WARN_FMT |
210 | "Unable to register controller with SCSI subsystem\n", | 212 | "Unable to register controller with SCSI subsystem\n", |
211 | ioc->name); | 213 | ioc->name); |
212 | return -1; | 214 | error = -1; |
215 | goto out_mptspi_probe; | ||
213 | } | 216 | } |
214 | 217 | ||
215 | spin_lock_irqsave(&ioc->FreeQlock, flags); | 218 | spin_lock_irqsave(&ioc->FreeQlock, flags); |
@@ -287,7 +290,7 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
287 | mem = kmalloc(sz, GFP_ATOMIC); | 290 | mem = kmalloc(sz, GFP_ATOMIC); |
288 | if (mem == NULL) { | 291 | if (mem == NULL) { |
289 | error = -ENOMEM; | 292 | error = -ENOMEM; |
290 | goto mptspi_probe_failed; | 293 | goto out_mptspi_probe; |
291 | } | 294 | } |
292 | 295 | ||
293 | memset(mem, 0, sz); | 296 | memset(mem, 0, sz); |
@@ -305,7 +308,7 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
305 | mem = kmalloc(sz, GFP_ATOMIC); | 308 | mem = kmalloc(sz, GFP_ATOMIC); |
306 | if (mem == NULL) { | 309 | if (mem == NULL) { |
307 | error = -ENOMEM; | 310 | error = -ENOMEM; |
308 | goto mptspi_probe_failed; | 311 | goto out_mptspi_probe; |
309 | } | 312 | } |
310 | 313 | ||
311 | memset(mem, 0, sz); | 314 | memset(mem, 0, sz); |
@@ -386,13 +389,13 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
386 | if(error) { | 389 | if(error) { |
387 | dprintk((KERN_ERR MYNAM | 390 | dprintk((KERN_ERR MYNAM |
388 | "scsi_add_host failed\n")); | 391 | "scsi_add_host failed\n")); |
389 | goto mptspi_probe_failed; | 392 | goto out_mptspi_probe; |
390 | } | 393 | } |
391 | 394 | ||
392 | scsi_scan_host(sh); | 395 | scsi_scan_host(sh); |
393 | return 0; | 396 | return 0; |
394 | 397 | ||
395 | mptspi_probe_failed: | 398 | out_mptspi_probe: |
396 | 399 | ||
397 | mptscsih_remove(pdev); | 400 | mptscsih_remove(pdev); |
398 | return error; | 401 | return error; |