From f08dcc55243f4af9e8edc0a1c48cfee06e6a0cd3 Mon Sep 17 00:00:00 2001 From: Pieter Van Trappen Date: Tue, 8 Jul 2025 17:24:46 +0200 Subject: cmd: fpga: improve user feedback in case of bitstream load failure In cmd/fpga.c, change some `debug` calls to `log_err` for important user feedback and use CMD_RET_FAILURE in favor of CMD_RET_USAGE due to its long output which hides the actual, useful return message. Change the remaining `debug` calls to `log_debug`. Remove all 'fpga:' and __func__ strings as log_* has this covered. For `do_fpga_loads`, move up the `do_fpga_check_params` call for more consistent command output; use a constant instead of multiple '5' use. In drivers/fpga/zynq*.c, change 'up to' to 'above' which corrects this confusing/wrong statement. Signed-off-by: Pieter Van Trappen Link: https://lore.kernel.org/r/20250708152455.1214487-2-vtpieter@gmail.com Signed-off-by: Michal Simek --- drivers/fpga/zynqmppl.c | 4 ++-- drivers/fpga/zynqpl.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/fpga') diff --git a/drivers/fpga/zynqmppl.c b/drivers/fpga/zynqmppl.c index 2b62bbbe3cf..1199b249e36 100644 --- a/drivers/fpga/zynqmppl.c +++ b/drivers/fpga/zynqmppl.c @@ -191,8 +191,8 @@ static int zynqmp_validate_bitstream(xilinx_desc *desc, const void *buf, } if ((ulong)buf < SZ_1M) { - printf("%s: Bitstream has to be placed up to 1MB (%px)\n", - __func__, buf); + log_err("Bitstream has to be placed above 1MB (%px)\n", + buf); return FPGA_FAIL; } diff --git a/drivers/fpga/zynqpl.c b/drivers/fpga/zynqpl.c index 3e86d854a01..5a37a33b0a7 100644 --- a/drivers/fpga/zynqpl.c +++ b/drivers/fpga/zynqpl.c @@ -360,8 +360,8 @@ static int zynq_validate_bitstream(xilinx_desc *desc, const void *buf, } if ((u32)buf < SZ_1M) { - printf("%s: Bitstream has to be placed up to 1MB (%x)\n", - __func__, (u32)buf); + log_err("Bitstream has to be placed above 1MB (%x)\n", + (u32)buf); return FPGA_FAIL; } -- cgit v1.2.3