diff mbox series

[v3,1/2] board: gateworks: venice: add additional levels for dtb name match

Message ID 20220414200052.30805-1-tharvey@gateworks.com
State Accepted
Commit 93de85c9d76a45c3e1f9efc8894d356c9898255f
Delegated to: Stefano Babic
Headers show
Series [v3,1/2] board: gateworks: venice: add additional levels for dtb name match | expand

Commit Message

Tim Harvey April 14, 2022, 8 p.m. UTC
Gateworks produces many products from a single PCB with subloaded
components. Add an additional two levels of dtb name matching so that
for example a GW7400-A matches the dtb name of gw74xx.dtb

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
v3: no changes - rebase
---
 board/gateworks/venice/eeprom.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Fabio Estevam April 16, 2022, 12:12 p.m. UTC | #1
On Thu, Apr 14, 2022 at 5:00 PM Tim Harvey <tharvey@gateworks.com> wrote:
>
> Gateworks produces many products from a single PCB with subloaded
> components. Add an additional two levels of dtb name matching so that
> for example a GW7400-A matches the dtb name of gw74xx.dtb
>
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>

Reviewed-by: Fabio Estevam <festevam@denx.de>
diff mbox series

Patch

diff --git a/board/gateworks/venice/eeprom.c b/board/gateworks/venice/eeprom.c
index 62b8125960c7..282d55f2ae30 100644
--- a/board/gateworks/venice/eeprom.c
+++ b/board/gateworks/venice/eeprom.c
@@ -259,8 +259,16 @@  const char *eeprom_get_dtb_name(int level, char *buf, int sz)
 			break;
 		case 2: /* don't care about PCB or BOM revision */
 			break;
+		case 3: /* don't care about last digit of model */
+			buf[strlen(buf) - 1] = 'x';
+			break;
+		case 4: /* don't care about last two digits of model */
+			buf[strlen(buf) - 1] = 'x';
+			buf[strlen(buf) - 2] = 'x';
+			break;
 		default:
 			return NULL;
+			break;
 		}
 	}