-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
uboot: fix tlv eeprom access to second eeprom (not used)
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
patches/u-boot/0014-cmd-tlv_eeprom-fix-alias-access-to-second-eeprom.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From 413ad975194c929a09199e6a67cf3d2b2f0fb337 Mon Sep 17 00:00:00 2001 | ||
From: Josua Mayer <josua@solid-run.com> | ||
Date: Wed, 20 Nov 2024 13:43:02 +0100 | ||
Subject: [PATCH] cmd: tlv_eeprom: fix alias access to second eeprom | ||
|
||
find function wrongly used ARRAY_SIZE function on a 2d pointer, always | ||
returning 1. Thus second eeprom can not be found. | ||
|
||
Replace with defined constant MAX_TLV_DEVICES. | ||
|
||
Fixes: "cmd: tlv_eeprom: support specifying tlv eeprom in DT alias tlv[0-255]" | ||
Signed-off-by: Josua Mayer <josua@solid-run.com> | ||
--- | ||
cmd/tlv_eeprom.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/cmd/tlv_eeprom.c b/cmd/tlv_eeprom.c | ||
index 546ede2dda2..881d7a8e3e6 100644 | ||
--- a/cmd/tlv_eeprom.c | ||
+++ b/cmd/tlv_eeprom.c | ||
@@ -906,7 +906,7 @@ static int find_tlv_devices(struct udevice **tlv_devices_p) | ||
struct udevice *dev; | ||
|
||
/* find by alias */ | ||
- for (int i = 0; i < ARRAY_SIZE(tlv_devices_p); i++) { | ||
+ for (int i = 0; i < MAX_TLV_DEVICES; i++) { | ||
snprintf(alias_name, sizeof(alias_name), "tlv%d", i); | ||
node = ofnode_get_aliases_node(alias_name); | ||
if (!ofnode_valid(node)) | ||
-- | ||
2.43.0 | ||
|