[PATCH] board: ge: common: vpd: Fix read_i2c_vpd return value

Francois Berder fberder at outlook.fr
Sat Jan 31 12:29:01 CET 2026


If i2c_eeprom_size fails, the error value is stored in
variable size and not ret.
Also, this commit fixes printing the error value.

Signed-off-by: Francois Berder <fberder at outlook.fr>
---
 board/ge/common/vpd_reader.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/ge/common/vpd_reader.c b/board/ge/common/vpd_reader.c
index c28d2c03cfe..2422db38013 100644
--- a/board/ge/common/vpd_reader.c
+++ b/board/ge/common/vpd_reader.c
@@ -215,8 +215,8 @@ int read_i2c_vpd(struct vpd_cache *cache,
 
 	size = i2c_eeprom_size(dev);
 	if (size < 0) {
-		printf("Unable to get size of eeprom: %d\n", ret);
-		return ret;
+		printf("Unable to get size of eeprom: %d\n", size);
+		return size;
 	}
 
 	data = malloc(size);
-- 
2.43.0




More information about the U-Boot mailing list