From e8eeb3502828729d41dbb717bde481587f25ede5 Mon Sep 17 00:00:00 2001 From: Christoffer Sandberg Date: Fri, 23 Dec 2022 09:52:20 +0100 Subject: [PATCH] Avoid further feature identification if interface is missing --- src/tuxedo_io/tuxedo_io.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tuxedo_io/tuxedo_io.c b/src/tuxedo_io/tuxedo_io.c index 607fc34..a4dc62f 100644 --- a/src/tuxedo_io/tuxedo_io.c +++ b/src/tuxedo_io/tuxedo_io.c @@ -153,9 +153,12 @@ void uw_id_tdp(void) static u32 uniwill_identify(void) { - uw_feats = uniwill_get_device_features(); - uw_id_tdp(); - return uniwill_get_active_interface_id(NULL) == 0 ? 1 : 0; + u32 result = uniwill_get_active_interface_id(NULL) == 0 ? 1 : 0; + if (result) { + uw_feats = uniwill_get_device_features(); + uw_id_tdp(); + } + return result; } /*static int fop_open(struct inode *inode, struct file *file)