Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754499AbbKCM4P (ORCPT ); Tue, 3 Nov 2015 07:56:15 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:41505 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754349AbbKCMzX (ORCPT ); Tue, 3 Nov 2015 07:55:23 -0500 X-AuditID: cbfee61a-f79a06d000005c6f-e4-5638aeb04e90 From: Robert Baldyga To: balbi@ti.com Cc: gregkh@linuxfoundation.org, andrzej.p@samsung.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Baldyga Subject: [PATCH 19/23] usb: gadget: configfs: add new composite API support Date: Tue, 03 Nov 2015 13:53:58 +0100 Message-id: <1446555242-3733-20-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1446555242-3733-1-git-send-email-r.baldyga@samsung.com> References: <1446555242-3733-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCLMWRmVeSWpSXmKPExsVy+t9jQd0N6yzCDC61yFjMetnOYrFxxnpW i4P36y2aF69ns7i8aw6bxaJlrcwWa4/cZbd4cHgnuwOHx/65a9g9+rasYvQ4fmM7k8fnTXIB LFFcNimpOZllqUX6dglcGW9O97IX/OGpuDzjInsD4zuuLkYODgkBE4kX9+y7GDmBTDGJC/fW s3UxcnEICcxilJgzt40RwvnJKHH7VCMrSBWbgI7Elu8TGEFsEQEBifUvLrGDFDELnGOUeHin DSwhLOAt8XZjNxOIzSKgKrFp9w42EJtXwFXi4f5FzBDr5CROHpvMCnIFJ1D80jtlEFNIwEXi +HaeCYy8CxgZVjFKpBYkFxQnpeca5qWW6xUn5haX5qXrJefnbmIEh9UzqR2MB3e5H2IU4GBU 4uFdsMQ8TIg1say4MvcQowQHs5II7+65FmFCvCmJlVWpRfnxRaU5qcWHGKU5WJTEefU9jcKE BNITS1KzU1MLUotgskwcnFINjOUWMcuiLwr5eRW81bl+98ipHeVTbnXMfsQ0pVnlY8o7xW/b nlvx7n63SZrb6oH4wk1fBL6/kwpXiNN/Fl+/7GeepNgKye8ni62t5vye+O+gZL7hr8/OBs6r Eztl3fo6O7PsYkWSqs40zdzGJtH47mYE82J+rcjkzL8pXpoHbSUPxy3uU7+fr8RSnJFoqMVc VJwIANkmYLAnAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1844 Lines: 66 Handle functions using new API properly. Signed-off-by: Robert Baldyga --- 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 d2101d8..fa5334f 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -1424,6 +1424,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) { @@ -1432,10 +1437,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); @@ -1452,6 +1470,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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/