[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1454503191-11796-21-git-send-email-r.baldyga@samsung.com>
Date: Wed, 03 Feb 2016 13:39:28 +0100
From: Robert Baldyga <r.baldyga@...sung.com>
To: balbi@...com
Cc: gregkh@...uxfoundation.org, andrzej.p@...sung.com,
m.szyprowski@...sung.com, b.zolnierkie@...sung.com,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
Robert Baldyga <r.baldyga@...sung.com>
Subject: [PATCH v4 20/43] usb: gadget: configfs: add new composite API support
Handle functions using new API properly.
Signed-off-by: Robert Baldyga <r.baldyga@...sung.com>
---
drivers/usb/gadget/configfs.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index fb3c9ba..60c6898 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -1358,6 +1358,11 @@ static int configfs_composite_bind(struct usb_gadget *gadget,
goto err_purge_funcs;
}
}
+
+ ret = usb_config_do_bind(c);
+ if (ret)
+ goto err_purge_funcs;
+
usb_ep_autoconfig_reset(cdev->gadget);
}
if (cdev->use_os_string) {
@@ -1366,10 +1371,23 @@ static int configfs_composite_bind(struct usb_gadget *gadget,
goto err_purge_funcs;
}
+ ret = composite_prep_vendor_descs(cdev);
+ if (ret < 0)
+ goto err_free_vendor_descs;
+
+ ret = composite_generate_old_descs(cdev);
+ if (ret < 0)
+ goto err_free_old_descs;
+
usb_ep_autoconfig_reset(cdev->gadget);
return 0;
+err_free_old_descs:
+ composite_free_old_descs(cdev);
+err_free_vendor_descs:
+ composite_free_vendor_descs(cdev);
err_purge_funcs:
+ composite_free_descs(cdev);
purge_configs_funcs(gi);
err_comp_cleanup:
composite_dev_cleanup(cdev);
@@ -1386,6 +1404,10 @@ static void configfs_composite_unbind(struct usb_gadget *gadget)
cdev = get_gadget_data(gadget);
gi = container_of(cdev, struct gadget_info, cdev);
+ composite_free_old_descs(cdev);
+ composite_free_vendor_descs(cdev);
+ composite_free_descs(cdev);
+
kfree(otg_desc[0]);
otg_desc[0] = NULL;
purge_configs_funcs(gi);
--
1.9.1
Powered by blists - more mailing lists