[SCSI] Alter the scsi_add_device() API to conform to what users expect
authorJames Bottomley <James.Bottomley@steeleye.com>
Sat, 10 Sep 2005 17:44:09 +0000 (12:44 -0500)
committerJames Bottomley <jejb@mulgrave.(none)>
Sat, 10 Sep 2005 19:43:25 +0000 (14:43 -0500)
commit146f7262ee0ec7fc6882f06e5fcb13883308073c
treeccaea3545313046dce9e012f8db5ef57236e0f90
parentb70d37bf61f278f9d9adf17c52af6b2d0ae7800c
[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>
drivers/ieee1394/sbp2.c
drivers/scsi/scsi_scan.c
include/scsi/scsi_device.h