From patchwork Wed Apr 18 15:26:50 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: 153533 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 57C36B6EEC for ; Thu, 19 Apr 2012 01:27:59 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6BB2B280AA; Wed, 18 Apr 2012 17:27:39 +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 aJkf4-Ik6gfH; Wed, 18 Apr 2012 17:27:39 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 195EF28097; Wed, 18 Apr 2012 17:27:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D0A4028082 for ; Wed, 18 Apr 2012 17:27:04 +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 E0PvYenKz2Z6 for ; Wed, 18 Apr 2012 17:27:00 +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 1AD8D28080 for ; Wed, 18 Apr 2012 17:26:58 +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 <0M2O003HRLK5SO20@mailout3.w1.samsung.com> for u-boot@lists.denx.de; Wed, 18 Apr 2012 16:26:29 +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 <0M2O00L6XLKVNK@spt1.w1.samsung.com> for u-boot@lists.denx.de; Wed, 18 Apr 2012 16:26:55 +0100 (BST) Received: from mcdsrvbld02.digital.local (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id 2470A27005D; Wed, 18 Apr 2012 17:39:38 +0200 (CEST) Date: Wed, 18 Apr 2012 17:26:50 +0200 From: Lukasz Majewski In-reply-to: <1334762811-23068-1-git-send-email-l.majewski@samsung.com> To: u-boot@lists.denx.de Message-id: <1334762811-23068-3-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.9.1 References: <1334214931-19480-1-git-send-email-l.majewski@samsung.com> <1334762811-23068-1-git-send-email-l.majewski@samsung.com> Cc: Marek Vasut , Kyungmin Park Subject: [U-Boot] [PATCH v4 2/3] 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 Acked-by: Marek Vasut --- 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)