From patchwork Fri Jun 24 20:04:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jassi Brar X-Patchwork-Id: 2313 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 085E323F08 for ; Fri, 24 Jun 2011 20:04:57 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id BA7D9A1800D for ; Fri, 24 Jun 2011 20:04:56 +0000 (UTC) Received: by qyk30 with SMTP id 30so2258008qyk.11 for ; Fri, 24 Jun 2011 13:04:56 -0700 (PDT) Received: by 10.224.199.136 with SMTP id es8mr2337000qab.390.1308945896046; Fri, 24 Jun 2011 13:04:56 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.230.139 with SMTP id jm11cs58454qcb; Fri, 24 Jun 2011 13:04:55 -0700 (PDT) Received: by 10.236.161.232 with SMTP id w68mr6484301yhk.24.1308945894893; Fri, 24 Jun 2011 13:04:54 -0700 (PDT) Received: from mail-pv0-f178.google.com (mail-pv0-f178.google.com [74.125.83.178]) by mx.google.com with ESMTPS id g63si17100762yhn.28.2011.06.24.13.04.54 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Jun 2011 13:04:54 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.178 is neither permitted nor denied by best guess record for domain of jaswinder.singh@linaro.org) client-ip=74.125.83.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.83.178 is neither permitted nor denied by best guess record for domain of jaswinder.singh@linaro.org) smtp.mail=jaswinder.singh@linaro.org Received: by pvg7 with SMTP id 7so2219038pvg.37 for ; Fri, 24 Jun 2011 13:04:53 -0700 (PDT) Received: by 10.68.32.167 with SMTP id k7mr1978394pbi.438.1308945893458; Fri, 24 Jun 2011 13:04:53 -0700 (PDT) Received: from localhost.localdomain ([122.167.86.144]) by mx.google.com with ESMTPS id x1sm2289206pbb.2.2011.06.24.13.04.49 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Jun 2011 13:04:52 -0700 (PDT) From: Jassi Brar To: linux-usb@vger.kernel.org Cc: stern@rowland.harvard.edu, laurent.pinchart@ideasonboard.com, gregkh@suse.de, patches@linaro.org, balbi@ti.com, ti@lists.linaro.org, Jassi Brar Subject: [PATCH 1/3] USB: Gadget: Add private data hook for config Date: Sat, 25 Jun 2011 01:34:43 +0530 Message-Id: <1308945883-643-1-git-send-email-jaswinder.singh@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1308945851-607-1-git-send-email-jaswinder.singh@linaro.org> References: <1308945851-607-1-git-send-email-jaswinder.singh@linaro.org> Currently gadget drivers, which do, allocate resources for functions during configuration bind, and free them during function unbind. Which isn't very correct, even though it works for now. Provide a hook in 'struct usb_configuration' as a way for configurations to save pointer to resources allocated during 'bind', which might come handy during 'unbind'. Signed-off-by: Jassi Brar --- include/linux/usb/composite.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 3d29a7d..e94339d 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h @@ -219,6 +219,8 @@ struct usb_configuration { struct usb_composite_dev *cdev; /* private: */ + /* Gadget driver specific data, typically for use at unbind */ + void *data; /* internals */ struct list_head list; struct list_head functions;