]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: microchip: icicle: correct type for node offset
authorConor Dooley <conor.dooley@microchip.com>
Wed, 15 May 2024 15:04:30 +0000 (16:04 +0100)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Thu, 30 May 2024 08:00:52 +0000 (16:00 +0800)
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>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
board/microchip/mpfs_icicle/mpfs_icicle.c

index 0f5f82924e7732493aee3ef793332cc175716764..844937951c0607449fea3bd21ac095ba83e70b4f 100644 (file)
@@ -73,7 +73,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];