diff options
Diffstat (limited to 'include/linux/usb/gadget.h')
-rw-r--r-- | include/linux/usb/gadget.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index f4b7ca516cdd..d3ef42d7d2f0 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -494,9 +494,13 @@ static inline void set_gadget_data(struct usb_gadget *gadget, void *data) | |||
494 | { dev_set_drvdata(&gadget->dev, data); } | 494 | { dev_set_drvdata(&gadget->dev, data); } |
495 | static inline void *get_gadget_data(struct usb_gadget *gadget) | 495 | static inline void *get_gadget_data(struct usb_gadget *gadget) |
496 | { return dev_get_drvdata(&gadget->dev); } | 496 | { return dev_get_drvdata(&gadget->dev); } |
497 | static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev) | ||
498 | { | ||
499 | return container_of(dev, struct usb_gadget, dev); | ||
500 | } | ||
497 | 501 | ||
498 | /* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */ | 502 | /* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */ |
499 | #define gadget_for_each_ep(tmp,gadget) \ | 503 | #define gadget_for_each_ep(tmp, gadget) \ |
500 | list_for_each_entry(tmp, &(gadget)->ep_list, ep_list) | 504 | list_for_each_entry(tmp, &(gadget)->ep_list, ep_list) |
501 | 505 | ||
502 | 506 | ||