From: Matthew Wilcox Date: Fri, 30 Apr 2010 19:11:30 +0000 (-0600) Subject: USB: Turn interface_to_usbdev into an inline function X-Git-Tag: v2.6.35-rc1~471^2~104 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e429018b646bdf903554e92ead1cda96cc552dc;p=platform%2Fupstream%2Fkernel-adaptation-pc.git USB: Turn interface_to_usbdev into an inline function The stronger type-checking would have prevented a bug I had. Signed-off-by: Matthew Wilcox Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/linux/usb.h b/include/linux/usb.h index fd7d61e..cf3b289 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -184,8 +184,6 @@ struct usb_interface { struct work_struct reset_ws; /* for resets in atomic context */ }; #define to_usb_interface(d) container_of(d, struct usb_interface, dev) -#define interface_to_usbdev(intf) \ - container_of(intf->dev.parent, struct usb_device, dev) static inline void *usb_get_intfdata(struct usb_interface *intf) { @@ -493,6 +491,11 @@ struct usb_device { }; #define to_usb_device(d) container_of(d, struct usb_device, dev) +static inline struct usb_device *interface_to_usbdev(struct usb_interface *intf) +{ + return to_usb_device(intf->dev.parent); +} + extern struct usb_device *usb_get_dev(struct usb_device *dev); extern void usb_put_dev(struct usb_device *dev);