[PATCH v4 17/21] dm: treewide: Use uclass_next_device_err when accessing second device

Michal Suchanek msuchanek at suse.de
Sun Sep 25 10:28:10 CEST 2022


There are a couple users of uclass_next_device return value that get the
first device by other means and use uclass_next_device assuming the
following device in the uclass is related to the first one.

Use uclass_next_device_err because the return value from
uclass_next_device will be removed in a later patch.

Signed-off-by: Michal Suchanek <msuchanek at suse.de>
---
 arch/arm/mach-k3/j721s2_init.c  | 2 +-
 board/atmel/common/mac_eeprom.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-k3/j721s2_init.c b/arch/arm/mach-k3/j721s2_init.c
index 12da8136f9..dd0c7ba18f 100644
--- a/arch/arm/mach-k3/j721s2_init.c
+++ b/arch/arm/mach-k3/j721s2_init.c
@@ -164,7 +164,7 @@ void board_init_f(ulong dummy)
 		if (ret)
 			panic("DRAM 0 init failed: %d\n", ret);
 
-		ret = uclass_next_device(&dev);
+		ret = uclass_next_device_err(&dev);
 		if (ret)
 			panic("DRAM 1 init failed: %d\n", ret);
 	}
diff --git a/board/atmel/common/mac_eeprom.c b/board/atmel/common/mac_eeprom.c
index a723ba723c..4606008c69 100644
--- a/board/atmel/common/mac_eeprom.c
+++ b/board/atmel/common/mac_eeprom.c
@@ -56,7 +56,7 @@ int at91_set_eth1addr(int offset)
 		return ret;
 
 	/* attempt to obtain a second eeprom device */
-	ret = uclass_next_device(&dev);
+	ret = uclass_next_device_err(&dev);
 	if (ret)
 		return ret;
 
-- 
2.37.3



More information about the U-Boot mailing list