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 <k.opas...@samsung.com>
---
 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;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to