diff options
Diffstat (limited to 'include/linux/usb/gadget.h')
-rw-r--r-- | include/linux/usb/gadget.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index f4b7ca516cdd..db6141cdb77b 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -494,6 +494,10 @@ 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) \ |