printk(KERN_ERR "Could not find device if %" PRIu64 "\n", cmd->dev_id); return NULL;
switch (scmd->scb[0]) { case INQUIRY: case REPORT_LUNS:  device = tgt_device_find(session->target, 0); break; }  if (!device) { eprintk("Could not find device %x %" PRIu64 "\n", scmd->scb[0], cmd->dev_id); return NULL; }
scsi_tgt_create_cmd(struct tgt_session *session, void *tgt_priv, uint8_t *scb,		    uint32_t data_len, enum dma_data_direction data_dir,		    uint8_t *lun, int lun_size, int tags){	struct tgt_device *device;	struct tgt_cmd *cmd;	struct scsi_tgt_cmd *scmd;	cmd = tgt_cmd_create(session, tgt_priv);	if (!cmd) {		printk(KERN_ERR "Could not allocate command\n");		return NULL;	}	scmd = tgt_cmd_to_scsi(cmd);	memcpy(scmd->scb, scb, sizeof(scmd->scb));	scmd->tags = tags;	/* translate target driver LUN to device id */	cmd->dev_id = scsi_tgt_translate_lun(lun, lun_size);	device = tgt_device_find(session->target, cmd->dev_id);	if (!device) {		printk(KERN_ERR "Could not find device if %" PRIu64 "\n",		       cmd->dev_id);		return NULL;	}	cmd->device = device;	/* is this device specific */	cmd->data_dir = data_dir;	/*	 * set bufflen based on data_len for now, but let device specific	 * handler overide just in case	 */	cmd->bufflen = data_len;	/* do scsi device specific setup */	device->dt->prep_cmd(cmd, data_len);	tgt_cmd_queue(cmd);	return cmd;}