@@ -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