/* fpga_add Add the device descriptor to the device table.  */
int fpga_add(fpga_type devtype, void *desc)
/* fpga_add Add the device descriptor to the device table.  */
int fpga_add(fpga_type devtype, void *desc)
{
	int devnum = FPGA_INVALID_DEVICE;
	if (!desc) {
		printf("%s: NULL device descriptor\n", __func__);
		return devnum;
	}
	if (next_desc < 0) {
		printf("%s: FPGA support not initialized!\n", __func__);
	} else if ((devtype > fpga_min_type) && (devtype < fpga_undefined)) {
		if (next_desc < CONFIG_MAX_FPGA_DEVICES) {
			devnum = next_desc;
			desc_table[next_desc].devtype = devtype;
			desc_table[next_desc++].devdesc = desc;
		} else {
			printf("%s: Exceeded Max FPGA device count\n",
			       __func__);
		}
	} else {
		printf("%s: Unsupported FPGA type %d\n", __func__, devtype);
	}
	return devnum;
}