[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>
This commit is contained in:
Jeff Garzik
2006-12-06 20:35:31 -08:00
committed by Linus Torvalds
parent 07354a0090
commit 3889b26beb
2 changed files with 21 additions and 10 deletions

View File

@ -220,7 +220,7 @@ static int i2o_scsi_probe(struct device *dev)
u32 id = -1;
u64 lun = -1;
int channel = -1;
int i;
int i, rc;
i2o_shost = i2o_scsi_get_host(c);
if (!i2o_shost)
@ -304,14 +304,20 @@ static int i2o_scsi_probe(struct device *dev)
return PTR_ERR(scsi_dev);
}
sysfs_create_link(&i2o_dev->device.kobj, &scsi_dev->sdev_gendev.kobj,
"scsi");
rc = sysfs_create_link(&i2o_dev->device.kobj,
&scsi_dev->sdev_gendev.kobj, "scsi");
if (rc)
goto err;
osm_info("device added (TID: %03x) channel: %d, id: %d, lun: %ld\n",
i2o_dev->lct_data.tid, channel, le32_to_cpu(id),
(long unsigned int)le64_to_cpu(lun));
return 0;
err:
scsi_remove_device(scsi_dev);
return rc;
};
static const char *i2o_scsi_info(struct Scsi_Host *SChost)