mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-28 10:01:32 +00:00
fpga: xilinx: Check if fpga operations are defined
Ensure that operations are correctly setup. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
345f9e1956
commit
6cd68c811e
1 changed files with 15 additions and 2 deletions
|
@ -139,6 +139,11 @@ int xilinx_load(xilinx_desc *desc, const void *buf, size_t bsize,
|
||||||
return FPGA_FAIL;
|
return FPGA_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!desc->operations || !desc->operations->load) {
|
||||||
|
printf("%s: Missing load operation\n", __func__);
|
||||||
|
return FPGA_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
return desc->operations->load(desc, buf, bsize, bstype);
|
return desc->operations->load(desc, buf, bsize, bstype);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,8 +156,10 @@ int xilinx_loadfs(xilinx_desc *desc, const void *buf, size_t bsize,
|
||||||
return FPGA_FAIL;
|
return FPGA_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!desc->operations->loadfs)
|
if (!desc->operations || !desc->operations->loadfs) {
|
||||||
|
printf("%s: Missing loadfs operation\n", __func__);
|
||||||
return FPGA_FAIL;
|
return FPGA_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
return desc->operations->loadfs(desc, buf, bsize, fpga_fsinfo);
|
return desc->operations->loadfs(desc, buf, bsize, fpga_fsinfo);
|
||||||
}
|
}
|
||||||
|
@ -165,6 +172,11 @@ int xilinx_dump(xilinx_desc *desc, const void *buf, size_t bsize)
|
||||||
return FPGA_FAIL;
|
return FPGA_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!desc->operations || !desc->operations->dump) {
|
||||||
|
printf("%s: Missing dump operation\n", __func__);
|
||||||
|
return FPGA_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
return desc->operations->dump(desc, buf, bsize);
|
return desc->operations->dump(desc, buf, bsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +240,8 @@ int xilinx_info(xilinx_desc *desc)
|
||||||
|
|
||||||
if (desc->iface_fns) {
|
if (desc->iface_fns) {
|
||||||
printf ("Device Function Table @ 0x%p\n", desc->iface_fns);
|
printf ("Device Function Table @ 0x%p\n", desc->iface_fns);
|
||||||
desc->operations->info(desc);
|
if (desc->operations && desc->operations->info)
|
||||||
|
desc->operations->info(desc);
|
||||||
} else
|
} else
|
||||||
printf ("No Device Function Table.\n");
|
printf ("No Device Function Table.\n");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue