linux/drivers/fpga/fpga-mgr.c
/**
 * fpga_mgr_register - register a FPGA manager
 * @mgr:	fpga manager struct created by fpga_mgr_create
 *
 * Return: 0 on success, negative error code otherwise.
 */
register a FPGA manager
@mgr:        fpga manager struct created by fpga_mgr_create

0 on success, negative error code otherwise.
register a FPGA manager @mgr : fpga manager struct created by fpga_mgr_create 0 on success negative error code otherwise .
int fpga_mgr_register(struct fpga_manager *mgr)
{
	int ret;
	mgr->state = mgr->mops->state(mgr);
	ret = device_add(&mgr->dev);
	if (ret)
		goto error_device;
	dev_info(&mgr->dev, "%s registered\n", mgr->name);
	return 0;
error_device:
	ida_simple_remove(&fpga_mgr_ida, mgr->dev.id);
	return ret;
}
int fpga_mgr_register ( struct fpga_manager * mgr ) { int ret ; mgr -> state = mgr -> mops -> state ( mgr ) ; ret = device_add ( & mgr -> dev ) ; if ( ret ) goto error_device ; dev_info ( & mgr -> dev , " \n " , mgr -> name ) ; return 0 ; error_device : ida_simple_remove ( & fpga_mgr_ida , mgr -> dev . id ) ; return ret ; }
fpga_mgr_register - register a FPGA manager
 @mgr:        fpga manager struct created by fpga_mgr_create
fpga_mgr_register - register a FPGA manager @mgr : fpga manager struct created by fpga_mgr_create
/*
	 * Initialize framework state by requesting low level driver read state
	 * from device.  FPGA may be in reset mode or may have been programmed
	 * by bootloader or EEPROM.
	 */