Find a device given the target (unlocked)
struct scsi_device * __scsi_device_lookup_by_target(struct scsi_target * starget, uint lun);
starget
SCSI target pointer
lun
SCSI Logical Unit Number
Looks up the scsi_device with the specified lun for a given starget. The returned scsi_device does not have an additional reference. You must hold the host's host_lock over this call and any access to the returned scsi_device. A scsi_device in state SDEV_DEL is skipped.
The only reason why drivers should use this is because they need to access the device list in irq context. Otherwise you really want to use scsi_device_lookup_by_target instead.