if (!starget) return ERR_PTR(-ENOMEM);  get_device(&starget->dev); down(&shost->scan_mutex); if (scsi_host_scan_allowed(shost)) { res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, hostdata); if (res != SCSI_SCAN_LUN_PRESENT) sdev = ERR_PTR(-ENODEV); } up(&shost->scan_mutex); scsi_target_reap(starget); put_device(&starget->dev);  return sdev;
scsi_device_put(sdev); return 0;
struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,				      uint id, uint lun, void *hostdata){	struct scsi_device *sdev;	struct device *parent = &shost->shost_gendev;	int res;	struct scsi_target *starget = scsi_alloc_target(parent, channel, id);	if (!starget)		return ERR_PTR(-ENOMEM);	get_device(&starget->dev);	down(&shost->scan_mutex);	if (scsi_host_scan_allowed(shost)) {		res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1,					     hostdata);		if (res != SCSI_SCAN_LUN_PRESENT)			sdev = ERR_PTR(-ENODEV);	}	up(&shost->scan_mutex);	scsi_target_reap(starget);	put_device(&starget->dev);	return sdev;}