/* Returns: 0 on success / -ENXIO if device does not exist  */
static int ibmvfc_slave_alloc(struct scsi_device *sdev)
/* Returns: 0 on success / -ENXIO if device does not exist  */
static int ibmvfc_slave_alloc(struct scsi_device *sdev)
{
	struct Scsi_Host *shost = sdev->host;
	struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
	struct ibmvfc_host *vhost = shost_priv(shost);
	unsigned long flags = 0;
	if (!rport || fc_remote_port_chkready(rport))
		return -ENXIO;
	spin_lock_irqsave(shost->host_lock, flags);
	sdev->hostdata = (void *)(unsigned long)vhost->task_set++;
	spin_unlock_irqrestore(shost->host_lock, flags);
	return 0;
}