From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sat, 14 Apr 2012 11:47:54 +0200 Subject: [U-Boot] [PATCH 3/4] usb:gadget: Wrapper for extracting usb_gadget from linux's device In-Reply-To: <1334214931-19480-4-git-send-email-l.majewski@samsung.com> References: <1334214931-19480-1-git-send-email-l.majewski@samsung.com> <1334214931-19480-4-git-send-email-l.majewski@samsung.com> Message-ID: <201204141147.54733.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Lukasz Majewski, > Signed-off-by: Lukasz Majewski > Signed-off-by: Kyungmin Park > Cc: Marek Vasut > --- > include/linux/usb/gadget.h | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h > index 275cb5f..b0a0e1f 100644 > --- a/include/linux/usb/gadget.h > +++ b/include/linux/usb/gadget.h > @@ -481,6 +481,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) Maybe you should put all these patches together and show us only the product -- the stripped down version of this composite driver. Best regards, Marek Vasut