 return count; 
return result; 
static ssize_t ipr_store_update_fw(struct class_device *class_dev,				       const char *buf, size_t count){	struct Scsi_Host *shost = class_to_shost(class_dev);	struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;	struct ipr_ucode_image_header *image_hdr;	const struct firmware *fw_entry;	struct ipr_sglist *sglist;	unsigned long lock_flags;	char fname[100];	char *src;	int len, result, dnld_size;	if (!capable(CAP_SYS_ADMIN))		return -EACCES;	len = snprintf(fname, 99, "%s", buf);	fname[len-1] = '\0';	if(request_firmware(&fw_entry, fname, &ioa_cfg->pdev->dev)) {		dev_err(&ioa_cfg->pdev->dev, "Firmware file %s not found\n", fname);		return -EIO;	}	image_hdr = (struct ipr_ucode_image_header *)fw_entry->data;	if (be32_to_cpu(image_hdr->header_length) > fw_entry->size ||	    (ioa_cfg->vpd_cbs->page3_data.card_type &&	     ioa_cfg->vpd_cbs->page3_data.card_type != image_hdr->card_type)) {		dev_err(&ioa_cfg->pdev->dev, "Invalid microcode buffer\n");		release_firmware(fw_entry);		return -EINVAL;	}	src = (u8 *)image_hdr + be32_to_cpu(image_hdr->header_length);	dnld_size = fw_entry->size - be32_to_cpu(image_hdr->header_length);	sglist = ipr_alloc_ucode_buffer(dnld_size);	if (!sglist) {		dev_err(&ioa_cfg->pdev->dev, "Microcode buffer allocation failed\n");		release_firmware(fw_entry);		return -ENOMEM;	}	result = ipr_copy_ucode_buffer(sglist, src, dnld_size);	if (result) {		dev_err(&ioa_cfg->pdev->dev,			"Microcode buffer copy to DMA buffer failed\n");		ipr_free_ucode_buffer(sglist);		release_firmware(fw_entry);		return result;	}	spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);	if (ioa_cfg->ucode_sglist) {		spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);		dev_err(&ioa_cfg->pdev->dev,			"Microcode download already in progress\n");		ipr_free_ucode_buffer(sglist);		release_firmware(fw_entry);		return -EIO;	}	ioa_cfg->ucode_sglist = sglist;	ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NORMAL);	spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);	wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);	spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);	ioa_cfg->ucode_sglist = NULL;	spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);	ipr_free_ucode_buffer(sglist);	release_firmware(fw_entry);	return count;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/12baa4202d74d799f4f8a4bd0455b485e4f8e876/ipr.c/clean/drivers/scsi/ipr.c