[v2,18/26] net/ntnic: add return value check

Message ID 20250505071309.586015-19-okl-plv@napatech.com (mailing list archive)
State Awaiting Upstream
Delegated to: Stephen Hemminger
Headers
Series net/ntnic: fixes and improvements |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Oleksandr Kolomeiets May 5, 2025, 7:12 a.m. UTC
From: Danylo Vodopianov <dvo-plv@napatech.com>

Add separate return value verification and logs for function.

Signed-off-by: Danylo Vodopianov <dvo-plv@napatech.com>
---
 .../nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c    | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Patch

diff --git a/drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c b/drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c
index 3528792845..cc6f7d13b5 100644
--- a/drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c
+++ b/drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c
@@ -528,7 +528,16 @@  static int nthw_fpga_rst_nt200a0x_init(struct fpga_info_s *p_fpga_info,
 	nthw_rac_rab_setup(p_fpga_info->mp_nthw_rac);
 
 	res = nthw_fpga_iic_scan(p_fpga, 0, 0);
+	if (res == -1) {
+		NT_LOG(ERR, NTHW, "Failed to init iic instance %d - %d for NT200 (%d)", 0, 0, res);
+		return -1;
+	}
+
 	res = nthw_fpga_iic_scan(p_fpga, 2, 3);
+	if (res == -1) {
+		NT_LOG(ERR, NTHW, "Failed to init iic instance %d - %d for NT200 (%d)", 2, 3, res);
+		return -1;
+	}
 
 	/*
 	 * Detect clock synth model