aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/i2o/i2o_scsi.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-12-06 23:35:31 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:31 -0500
commit3889b26bebd3e3cf5a3b95da683bab2f6462133d (patch)
tree83ca122f725e09dae209ac4e23203e7164649605 /drivers/message/i2o/i2o_scsi.c
parent07354a00901d103085e4376b7df0aad264c1836a (diff)
[PATCH] I2O: more error checking
i2o_scsi: handle sysfs failure i2o_device: * convert i2o_device_add() to return integer error code rather than pointer. Fortunately -nobody- checks the return code of this function, so changing has nil impact. * handle errors thrown by device_register() More work in i2o_device remains. Signed-off-by: Jeff Garzik <jeff@garzik.org> Cc: Markus Lidel <Markus.Lidel@shadowconnect.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/message/i2o/i2o_scsi.c')
-rw-r--r--drivers/message/i2o/i2o_scsi.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/message/i2o/i2o_scsi.c b/drivers/message/i2o/i2o_scsi.c
index 6ebf38213f9f..d5f93b12b6f1 100644
--- a/drivers/message/i2o/i2o_scsi.c
+++ b/drivers/message/i2o/i2o_scsi.c
@@ -220,7 +220,7 @@ static int i2o_scsi_probe(struct device *dev)
220 u32 id = -1; 220 u32 id = -1;
221 u64 lun = -1; 221 u64 lun = -1;
222 int channel = -1; 222 int channel = -1;
223 int i; 223 int i, rc;
224 224
225 i2o_shost = i2o_scsi_get_host(c); 225 i2o_shost = i2o_scsi_get_host(c);
226 if (!i2o_shost) 226 if (!i2o_shost)
@@ -304,14 +304,20 @@ static int i2o_scsi_probe(struct device *dev)
304 return PTR_ERR(scsi_dev); 304 return PTR_ERR(scsi_dev);
305 } 305 }
306 306
307 sysfs_create_link(&i2o_dev->device.kobj, &scsi_dev->sdev_gendev.kobj, 307 rc = sysfs_create_link(&i2o_dev->device.kobj,
308 "scsi"); 308 &scsi_dev->sdev_gendev.kobj, "scsi");
309 if (rc)
310 goto err;
309 311
310 osm_info("device added (TID: %03x) channel: %d, id: %d, lun: %ld\n", 312 osm_info("device added (TID: %03x) channel: %d, id: %d, lun: %ld\n",
311 i2o_dev->lct_data.tid, channel, le32_to_cpu(id), 313 i2o_dev->lct_data.tid, channel, le32_to_cpu(id),
312 (long unsigned int)le64_to_cpu(lun)); 314 (long unsigned int)le64_to_cpu(lun));
313 315
314 return 0; 316 return 0;
317
318err:
319 scsi_remove_device(scsi_dev);
320 return rc;
315}; 321};
316 322
317static const char *i2o_scsi_info(struct Scsi_Host *SChost) 323static const char *i2o_scsi_info(struct Scsi_Host *SChost)