firewire: sbp2: remove obsolete reference counting
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Sat, 27 Aug 2011 13:33:34 +0000 (15:33 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Fri, 16 Sep 2011 20:23:56 +0000 (22:23 +0200)
commit6ff8147d075da2e1eb69fab2ee75104c59f573e0
tree8153760829514f80842f5b36159513002b07e577
parentf39aa30d7741f40ad964341e9243dbbd7f8ff057
firewire: sbp2: remove obsolete reference counting

Since commit 0278ccd9d53e07c4e699432b2fed9de6c56f506c "firewire: sbp2:
fix panic after rmmod with slow targets", the lifetime of an sbp2_target
instance does no longer extent past the return of sbp2_remove().
Therefore it is no longer necessary to call fw_unit_get/put() and
fw_device_get/put() in sbp2_probe/remove().

Furthermore, said commit also ensures that lu->work is not going to be
executed or requeued at a time when the sbp2_target is no longer in use.
Hence there is no need for sbp2_target reference counting for lu->work.

Other concurrent contexts:

  - Processes which access the sysfs of the SCSI host device or of one
    of its subdevices are safe because these interfaces are all removed
    by scsi_remove_device/host() in sbp2_release_target().

  - SBP-2 command block ORB transactions are finished when
    scsi_remove_device() in sbp2_release_target() returns.

  - SBP-2 management ORB transactions are finished when
    cancel_delayed_work_sync(&lu->work) before sbp2_release_target()
    returns.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/firewire/sbp2.c