linux/drivers/fpga/fpga-mgr.c
/**
 * fpga_mgr_firmware_load - request firmware and load to fpga
 * @mgr:	fpga manager
 * @info:	fpga image specific information
 * @image_name:	name of image file on the firmware search path
 *
 * Request an FPGA image using the firmware class, then write out to the FPGA.
 * Update the state before each step to provide info on what step failed if
 * there is a failure.  This code assumes the caller got the mgr pointer
 * from of_fpga_mgr_get() or fpga_mgr_get() and checked that it is not an error
 * code.
 *
 * Return: 0 on success, negative error code otherwise.
 */
request firmware and load to fpga
@mgr:        fpga manager
@info:       fpga image specific information
@image_name: name of image file on the firmware search path

Request an FPGA image using the firmware class, then write out to the FPGA.
Update the state before each step to provide info on what step failed if
there is a failure.  This code assumes the caller got the mgr pointer
from of_fpga_mgr_get() or fpga_mgr_get() and checked that it is not an error
code.

0 on success, negative error code otherwise.
request firmware and load to fpga @mgr : fpga manager @info : fpga image specific information @image_name : name of image file on the firmware search path Request an FPGA image using the firmware class then write out to the FPGA . Update the state before each step to provide info on what step failed if there is a failure . This code assumes the caller got the mgr pointer from of_fpga_mgr_get () or fpga_mgr_get () and checked that it is not an error code . 0 on success negative error code otherwise .
static int fpga_mgr_firmware_load(struct fpga_manager *mgr,
				  struct fpga_image_info *info,
				  const char *image_name)
{
	struct device *dev = &mgr->dev;
	const struct firmware *fw;
	int ret;
	dev_info(dev, "writing %s to %s\n", image_name, mgr->name);
	mgr->state = FPGA_MGR_STATE_FIRMWARE_REQ;
	ret = request_firmware(&fw, image_name, dev);
	if (ret) {
		mgr->state = FPGA_MGR_STATE_FIRMWARE_REQ_ERR;
		dev_err(dev, "Error requesting firmware %s\n", image_name);
		return ret;
	}
	ret = fpga_mgr_buf_load(mgr, info, fw->data, fw->size);
	release_firmware(fw);
	return ret;
}
static int fpga_mgr_firmware_load ( struct fpga_manager * mgr , struct fpga_image_info * info , const char * image_name ) { struct device * dev = & mgr -> dev ; const struct firmware * fw ; int ret ; dev_info ( dev , " \n " , image_name , mgr -> name ) ; mgr -> state = FPGA_MGR_STATE_FIRMWARE_REQ ; ret = request_firmware ( & fw , image_name , dev ) ; if ( ret ) { mgr -> state = FPGA_MGR_STATE_FIRMWARE_REQ_ERR ; dev_err ( dev , " \n " , image_name ) ; return ret ; } ret = fpga_mgr_buf_load ( mgr , info , fw -> data , fw -> size ) ; release_firmware ( fw ) ; return ret ; }
fpga_mgr_firmware_load - request firmware and load to fpga
 @mgr:        fpga manager
 @info:       fpga image specific information
 @image_name: name of image file on the firmware search path
fpga_mgr_firmware_load - request firmware and load to fpga @mgr : fpga manager @info : fpga image specific information @image_name : name of image file on the firmware search path