From d231df67ff398011992ebfe449e919e19a0bd923 Mon Sep 17 00:00:00 2001 From: Christoffer Sandberg Date: Mon, 13 Feb 2023 15:32:38 +0100 Subject: [PATCH] Avoid feature identification if already done --- src/tuxedo_io/tuxedo_io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tuxedo_io/tuxedo_io.c b/src/tuxedo_io/tuxedo_io.c index 07e0f02..4ed06d0 100644 --- a/src/tuxedo_io/tuxedo_io.c +++ b/src/tuxedo_io/tuxedo_io.c @@ -48,6 +48,7 @@ static u32 id_check_clevo; static u32 id_check_uniwill; static struct uniwill_device_features_t *uw_feats; +static bool uw_feats_loaded = false; /** * strstr version of dmi_match @@ -154,9 +155,10 @@ void uw_id_tdp(void) static u32 uniwill_identify(void) { u32 result = uniwill_get_active_interface_id(NULL) == 0 ? 1 : 0; - if (result) { + if (result && !uw_feats_loaded) { uw_feats = uniwill_get_device_features(); uw_id_tdp(); + uw_feats_loaded = true; } return result; }