From 7186c327bfaa9b87b28c6d4315169baa61b3496a Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Fri, 12 Jun 2020 20:17:08 +0000 Subject: Fix reading capability --- mdk-stage1/probing.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'mdk-stage1') diff --git a/mdk-stage1/probing.c b/mdk-stage1/probing.c index bce905686..db99fb56f 100644 --- a/mdk-stage1/probing.c +++ b/mdk-stage1/probing.c @@ -666,10 +666,9 @@ void find_media(enum media_bus bus) strcpy(pathend, "/device/model"); read_attribute(path, model+vendor_length); - strcpy(pathend, "/device/capability"); - strcpy(buf, "0x0"); - read_attribute(path, buf+3); - int caps = atoi(buf); + strcpy(pathend, "/capability"); + read_attribute(path, buf); + long caps = strtol(buf, NULL, 16); if (!(caps & 0x0010)) { log_message("Ignoring device %s (not up)", name); -- cgit v1.2.1