@@ -496,11 +496,9 @@ static int pscsi_configure_device(struct se_device *dev)
}
spin_lock_irq(sh->host_lock);
- list_for_each_entry(sd, &sh->__devices, siblings) {
- if ((pdv->pdv_channel_id != sd->channel) ||
- (pdv->pdv_target_id != sd->id) ||
- (pdv->pdv_lun_id != sd->lun))
- continue;
+ sd = __scsi_device_lookup(sh, pdv->pdv_channel_id,
+ pdv->pdv_target_id, pdv->pdv_lun_id);
+ if (sd) {
/*
* Functions will release the held struct scsi_host->host_lock
* before calling calling pscsi_add_device_to_list() to register
Instead of walking the list of devices manually use the helper function to return the device directly. Signed-off-by: Hannes Reinecke <hare@suse.de> --- drivers/target/target_core_pscsi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)