diff mbox series

[v1,1/2] board: microchip: icicle: correct type for node offset

Message ID 20240515150434.406916-2-conor@kernel.org
State New
Delegated to: Andes
Headers show
Series Two mpfs icicle init fixes | expand

Commit Message

Conor Dooley May 15, 2024, 3:04 p.m. UTC
From: Conor Dooley <conor.dooley@microchip.com>

Node offsets returned by libfdt can contain negative error numbers, so
the variable type should be "int". As things stand, if the ethernet
nodes are not found in the early init callback, the if (node < 0) tests
pass and the code errors out while trying to set the local-mac-address
for a non-existent node.

Fixes: 64413e1b7c ("riscv: Add Microchip MPFS Icicle Kit support")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
 board/microchip/mpfs_icicle/mpfs_icicle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/board/microchip/mpfs_icicle/mpfs_icicle.c b/board/microchip/mpfs_icicle/mpfs_icicle.c
index 7beac33cfb..5fd0ec66a9 100644
--- a/board/microchip/mpfs_icicle/mpfs_icicle.c
+++ b/board/microchip/mpfs_icicle/mpfs_icicle.c
@@ -72,7 +72,7 @@  int board_early_init_f(void)
 int board_late_init(void)
 {
 	u32 ret;
-	u32 node;
+	int node;
 	u8 idx;
 	u8 device_serial_number[16] = { 0 };
 	unsigned char mac_addr[6];