From patchwork Wed May 2 11:11:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Majewski?= X-Patchwork-Id: 156418 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 1662CB6FBA for ; Wed, 2 May 2012 21:12:58 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BD6E1280D9; Wed, 2 May 2012 13:12:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xRFMOb-PUCEv; Wed, 2 May 2012 13:12:36 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1F285280DA; Wed, 2 May 2012 13:12:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 41D59280B5 for ; Wed, 2 May 2012 13:12:12 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s5JxhPR1JZPM for ; Wed, 2 May 2012 13:12:11 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by theia.denx.de (Postfix) with ESMTP id 5CB83280C1 for ; Wed, 2 May 2012 13:12:10 +0200 (CEST) MIME-version: 1.0 Received: from euspt1 ([210.118.77.13]) by mailout3.w1.samsung.com (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0M3E0030M734MY10@mailout3.w1.samsung.com> for u-boot@lists.denx.de; Wed, 02 May 2012 12:11:28 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M3E00GG57444T@spt1.w1.samsung.com> for u-boot@lists.denx.de; Wed, 02 May 2012 12:12:05 +0100 (BST) Received: from mcdsrvbld02.digital.local (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id A4167270051; Wed, 02 May 2012 13:14:10 +0200 (CEST) Date: Wed, 02 May 2012 13:11:37 +0200 From: Lukasz Majewski In-reply-to: <1335957098-12929-1-git-send-email-l.majewski@samsung.com> To: u-boot@lists.denx.de Message-id: <1335957098-12929-5-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10 References: <1335957098-12929-1-git-send-email-l.majewski@samsung.com> Cc: Marek Vasut , Kyungmin Park Subject: [U-Boot] [RESEND PATCH 4/5] usb:gadget:composite: Support for composite at gadget.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Add device data pointer to the USB gadget's device struct. Wrapper for extracting usb_gadget from Linux's usb device Signed-off-by: Lukasz Majewski Signed-off-by: Kyungmin Park Cc: Marek Vasut --- Changes for v2: - Two separate patches regarding gadget.h file squashed together --- include/linux/usb/gadget.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 275cb5f..eba865e 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -411,6 +411,7 @@ struct usb_gadget_ops { struct device { void *driver_data; /* data private to the driver */ + void *device_data; /* data private to the device */ }; /** @@ -481,6 +482,11 @@ static inline void *get_gadget_data(struct usb_gadget *gadget) return gadget->dev.driver_data; } +static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev) +{ + return container_of(dev, struct usb_gadget, dev); +} + /* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */ #define gadget_for_each_ep(tmp, gadget) \ list_for_each_entry(tmp, &(gadget)->ep_list, ep_list)