diff options
author | Paweł Szewczyk <p.szewczyk@samsung.com> | 2018-03-15 18:51:51 +0100 |
---|---|---|
committer | Paweł Szewczyk <p.szewczyk@samsung.com> | 2018-03-22 11:19:10 +0100 |
commit | 30ba310824bf3467ffb92f6a13df2c6cf7d0b6ed (patch) | |
tree | b2873fa38c7706c85ab0761bcfe53da6ab64cfc3 /hw | |
parent | 3dc49fa3e33e731e9f56b83e65b99ac7a894577b (diff) | |
download | device-manager-plugin-odroid-30ba310824bf3467ffb92f6a13df2c6cf7d0b6ed.tar.gz device-manager-plugin-odroid-30ba310824bf3467ffb92f6a13df2c6cf7d0b6ed.tar.bz2 device-manager-plugin-odroid-30ba310824bf3467ffb92f6a13df2c6cf7d0b6ed.zip |
usb: Assign new functions to legacy gadget
Change-Id: I86df0d0db29813781c8b49dc111f726b24b82041
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/usb_client/usb_client.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/usb_client/usb_client.c b/hw/usb_client/usb_client.c index 824e562..0f1effe 100644 --- a/hw/usb_client/usb_client.c +++ b/hw/usb_client/usb_client.c @@ -278,6 +278,7 @@ static int legacy_read_config(struct usb_gadget *gadget, char *sep = LEGACY_FUNC_SEP; int i, f_cnt; int f_idx; + int g_f_idx; int ret; ret = sys_get_str(cpath, buf, sizeof(buf)); @@ -301,6 +302,8 @@ static int legacy_read_config(struct usb_gadget *gadget, if (ret) return ret; + for (g_f_idx = 0; gadget->funcs[g_f_idx]; ++g_f_idx); + f_idx = 0; for (fname = strsep(&begin, sep); fname; fname = strsep(&begin, sep)) { struct usb_function *func; @@ -311,6 +314,8 @@ static int legacy_read_config(struct usb_gadget *gadget, ret = legacy_alloc_new_func(gadget, fname, &func); if (ret) goto free_config; + + gadget->funcs[g_f_idx++] = func; } config->funcs[f_idx++] = func; |