From c39fbd49312724a91141e65dd82be02e073f87b4 Mon Sep 17 00:00:00 2001 From: Krzysztof Opasiak Date: Tue, 1 Apr 2014 21:30:40 +0200 Subject: [PATCH] libusbgx: Fix missing read of bcdDevice. Value of bcdDevice has been never read from Config FS and this field was leaved uninitialized. Change usbg_parse_gadget_attrs() to read also from this file. Signed-off-by: Krzysztof Opasiak [Port from libusbg and update description] Signed-off-by: Krzysztof Opasiak --- src/usbg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/usbg.c b/src/usbg.c index be83407..e472463 100644 --- a/src/usbg.c +++ b/src/usbg.c @@ -844,6 +844,12 @@ static int usbg_parse_gadget_attrs(char *path, char *name, else goto out; + ret = usbg_read_hex(path, name, "bcdDevice", &buf); + if (ret == USBG_SUCCESS) + g_attrs->bcdDevice = (uint16_t) buf; + else + goto out; + ret = usbg_read_hex(path, name, "bDeviceClass", &buf); if (ret == USBG_SUCCESS) g_attrs->bDeviceClass = (uint8_t)buf; -- 2.7.4