diff options
Diffstat (limited to 'board/toradex')
-rw-r--r-- | board/toradex/common/tdx-cfg-block.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c index 68ec51f3ec..aff3dd4d32 100644 --- a/board/toradex/common/tdx-cfg-block.c +++ b/board/toradex/common/tdx-cfg-block.c @@ -421,6 +421,8 @@ static int get_cfgblock_interactive(void) static int get_cfgblock_barcode(char *barcode) { + char revision[3] = {barcode[6], barcode[7], '\0'}; + if (strlen(barcode) < 16) { printf("Argument too short, barcode is 16 chars long\n"); return -1; @@ -429,7 +431,7 @@ static int get_cfgblock_barcode(char *barcode) /* Get hardware information from the first 8 digits */ tdx_hw_tag.ver_major = barcode[4] - '0'; tdx_hw_tag.ver_minor = barcode[5] - '0'; - tdx_hw_tag.ver_assembly = barcode[7] - '0'; + tdx_hw_tag.ver_assembly = simple_strtoul(revision, NULL, 10); barcode[4] = '\0'; tdx_hw_tag.prodid = simple_strtoul(barcode, NULL, 10); |