diff options
Diffstat (limited to 'io-module/mts-io.c')
-rw-r--r-- | io-module/mts-io.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/io-module/mts-io.c b/io-module/mts-io.c index 63d695b..7078708 100644 --- a/io-module/mts-io.c +++ b/io-module/mts-io.c @@ -834,29 +834,26 @@ mts_id_eeprom_load(void) set_buttons(default_buttons); mts_hw_version = MTCPM_0_0; log_info("detected board %s", HW_VERSION_MTCPM_0_0); - } else { - if(noradio) { - struct attribute **ap = mtcdt_platform_attribute_group.attrs; - while(1) { - if(ap[j] == NULL) { - log_info("Did not find radio power attribute. Possible driver fault."); - break; - } - j++; - if (is_radio_power_attr_mtcdt(ap[j])) { - log_info("Pruning radio feature from mts-io",j); - ap[j] = NULL; - break; - } - } - } + } else { + int i; - attr_group = &mtcdt_platform_attribute_group; - gpio_pins = gpio_pins_mtcdt_0_0; - mts_hw_version = MTCDT_0_0; - set_buttons(default_buttons); - log_info("detected board %s", HW_VERSION_MTCDT_0_0); - } + for(i=0;i<sizeof id_eeprom.hw_version;i++) { + if(! id_eeprom.hw_version[i]) + /* Found NULL so done */ + break; + if(! isprint(id_eeprom.hw_version[i])) + break; + } + log_alert("Unsupported EEPROM settings or device"); + + if(i) + log_alert("Found unsupported EEPROM HW_VERSION: %.*s",i,id_eeprom.hw_version); + log_alert("Check log for HW_VERSION dump"); + + print_hex_dump_bytes("HW_VERSION: ", DUMP_PREFIX_OFFSET, id_eeprom.hw_version, sizeof id_eeprom.hw_version); + + return -ENODEV; + } log_info("sizeof: %lu", (unsigned long) sizeof(struct mts_id_eeprom_layout)); log_info("vendor-id: %.32s", id_eeprom.vendor_id); |