tlv_eeprom: do not start over with default contents if invalid
authorHugo Villeneuve <hvilleneuve@dimonoff.com>
Wed, 5 Nov 2025 17:18:23 +0000 (12:18 -0500)
committerHugo Villeneuve <hvilleneuve@dimonoff.com>
Mon, 17 Nov 2025 15:36:11 +0000 (10:36 -0500)
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
src/tlv_eeprom.c

index 967e6dd..0b1dbc2 100644 (file)
@@ -119,15 +119,6 @@ int read_eeprom(int devnum, u8 *eeprom)
        else if (ret == -ENODEV)
                return ret;
 
-       // If the contents are invalid, start over with default contents
-       if (!is_valid_tlvinfo_header(eeprom_hdr) ||
-           !is_checksum_valid(eeprom)) {
-               strcpy(eeprom_hdr->signature, TLV_INFO_ID_STRING);
-               eeprom_hdr->version = TLV_INFO_VERSION;
-               eeprom_hdr->totallen = cpu_to_be16(0);
-               update_crc(eeprom);
-       }
-
        return ret;
 }