diff options
author | Tom Rini <trini@konsulko.com> | 2018-03-25 12:00:00 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-03-25 12:00:00 -0400 |
commit | 89a650e0ffb89faaea1b9e6ad8cf2b38203435f2 (patch) | |
tree | 4827f512e3c1e6f2887133bbb9cb3ee9497ba603 /drivers/fpga/fpga.c | |
parent | 423effc04a195ce6a464eadadfa7f765bf786889 (diff) | |
parent | 8ae3d0b50cd22aebcd87022dc357d1cf0f3a879b (diff) |
Merge tag 'xilinx-for-v2018.05' of git://git.denx.de/u-boot-microblaze
Xilinx changes for v2018.05
- Fix mkimage recognition
- Update all my fragments
ZynqMP:
- Use clk driver
- Support loading elfs in el1
- Various DTS and defconfig changes
- Enable newer pmufw versions
- Support more clocks
- Remove ep108
- Secure image support
- Fix memtest setup
Zynq:
- Enabling watchdog driver
- Support more clocks
- defconfig changes
fpga:
- Simplify error path
net:
- GMII case update
Diffstat (limited to 'drivers/fpga/fpga.c')
-rw-r--r-- | drivers/fpga/fpga.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/fpga/fpga.c b/drivers/fpga/fpga.c index 6aead27f16..ac01612d75 100644 --- a/drivers/fpga/fpga.c +++ b/drivers/fpga/fpga.c @@ -148,20 +148,21 @@ 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 (desc) { - 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__); - } + 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: NULL device descriptor\n", __func__); + printf("%s: Exceeded Max FPGA device count\n", + __func__); } } else { printf("%s: Unsupported FPGA type %d\n", __func__, devtype); |