From 99fd108d0f4826def7a9b0aa02eb61b99ebbad22 Mon Sep 17 00:00:00 2001 From: Dr-Noob Date: Thu, 13 Apr 2023 17:41:32 +0200 Subject: [PATCH] [v1.03] Try detecting SoC with nvmem in last place (avoids usless work in Android) --- src/arm/soc.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/arm/soc.c b/src/arm/soc.c index 14c7a93..882f2f9 100644 --- a/src/arm/soc.c +++ b/src/arm/soc.c @@ -799,19 +799,23 @@ struct system_on_chip* get_soc(void) { soc = guess_soc_from_cpuinfo(soc); if(soc->soc_vendor == SOC_VENDOR_UNKNOWN) { - if(soc->raw_name != NULL) + if(soc->raw_name != NULL) { printWarn("SoC detection failed using /proc/cpuinfo: Found '%s' string", soc->raw_name); - else + } + else { printWarn("SoC detection failed using /proc/cpuinfo: No string found"); - // If cpufinfo detection fails, try with nvmem - soc = guess_soc_from_nvmem(soc); + } #ifdef __ANDROID__ soc = guess_soc_from_android(soc); - if(soc->raw_name == NULL) + if(soc->raw_name == NULL) { printWarn("SoC detection failed using Android: No string found"); - else if(soc->soc_vendor == SOC_VENDOR_UNKNOWN) + } + else if(soc->soc_vendor == SOC_VENDOR_UNKNOWN) { printWarn("SoC detection failed using Android: Found '%s' string", soc->raw_name); + } #endif // ifdef __ANDROID__ + // If cpufinfo detection fails, try with nvmem + soc = guess_soc_from_nvmem(soc); } #elif defined __APPLE__ || __MACH__ soc = guess_soc_apple(soc);