drivers: fpga: shell: add shell load error handling
Check if the call was successful, print an error otherwise.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
diff --git a/drivers/fpga/fpga_shell.c b/drivers/fpga/fpga_shell.c
index 7969e23..af1a28e 100644
--- a/drivers/fpga/fpga_shell.c
+++ b/drivers/fpga/fpga_shell.c
@@ -93,8 +93,11 @@
shell_print(sh, "%s: loading bitstream", dev->name);
- fpga_load(dev, (uint32_t *)strtol(argv[2], NULL, 0),
- (uint32_t)atoi(argv[3]));
+ err = fpga_load(dev, (uint32_t *)strtol(argv[2], NULL, 0),
+ (uint32_t)atoi(argv[3]));
+ if (err) {
+ shell_error(sh, "Error: %d", err);
+ }
return err;
}