diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2005-09-10 21:44:09 +0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-09-10 23:43:25 +0400 |
commit | 146f7262ee0ec7fc6882f06e5fcb13883308073c (patch) | |
tree | ccaea3545313046dce9e012f8db5ef57236e0f90 /drivers/ieee1394/sbp2.c | |
parent | b70d37bf61f278f9d9adf17c52af6b2d0ae7800c (diff) | |
download | linux-146f7262ee0ec7fc6882f06e5fcb13883308073c.tar.xz |
[SCSI] Alter the scsi_add_device() API to conform to what users expect
The original API returned either an ERR_PTR() or a refcounted sdev.
Unfortunately, if it's successful, you need to do a scsi_device_put() on
the sdev otherwise the refcounting is wrong.
Everyone seems to expect that scsi_add_device() should be callable
without doing the ref put, so alter the API so it is (we still have
__scsi_add_device with the original behaviour).
The only actual caller that needs altering is the one in firewire ...
not because it gets this right, but because it acts on the error if one
is returned.
Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/ieee1394/sbp2.c')
-rw-r--r-- | drivers/ieee1394/sbp2.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index 627af507643a..de88218ef7cc 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c @@ -790,7 +790,7 @@ static void sbp2_host_reset(struct hpsb_host *host) static int sbp2_start_device(struct scsi_id_instance_data *scsi_id) { struct sbp2scsi_host_info *hi = scsi_id->hi; - struct scsi_device *sdev; + int error; SBP2_DEBUG("sbp2_start_device"); @@ -939,10 +939,10 @@ alloc_fail: sbp2_max_speed_and_size(scsi_id); /* Add this device to the scsi layer now */ - sdev = scsi_add_device(scsi_id->scsi_host, 0, scsi_id->ud->id, 0); - if (IS_ERR(sdev)) { + error = scsi_add_device(scsi_id->scsi_host, 0, scsi_id->ud->id, 0); + if (error) { SBP2_ERR("scsi_add_device failed"); - return PTR_ERR(sdev); + return error; } return 0; |