diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2005-09-10 13:44:09 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-09-10 15:43:25 -0400 |
commit | 146f7262ee0ec7fc6882f06e5fcb13883308073c (patch) | |
tree | ccaea3545313046dce9e012f8db5ef57236e0f90 /include/scsi/scsi_device.h | |
parent | b70d37bf61f278f9d9adf17c52af6b2d0ae7800c (diff) |
[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 'include/scsi/scsi_device.h')
-rw-r--r-- | include/scsi/scsi_device.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index da63722c0123..c0e4c67d836f 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -178,8 +178,8 @@ static inline struct scsi_target *scsi_target(struct scsi_device *sdev) | |||
178 | 178 | ||
179 | extern struct scsi_device *__scsi_add_device(struct Scsi_Host *, | 179 | extern struct scsi_device *__scsi_add_device(struct Scsi_Host *, |
180 | uint, uint, uint, void *hostdata); | 180 | uint, uint, uint, void *hostdata); |
181 | #define scsi_add_device(host, channel, target, lun) \ | 181 | extern int scsi_add_device(struct Scsi_Host *host, uint channel, |
182 | __scsi_add_device(host, channel, target, lun, NULL) | 182 | uint target, uint lun); |
183 | extern void scsi_remove_device(struct scsi_device *); | 183 | extern void scsi_remove_device(struct scsi_device *); |
184 | extern int scsi_device_cancel(struct scsi_device *, int); | 184 | extern int scsi_device_cancel(struct scsi_device *, int); |
185 | 185 | ||