提交 1e429018 编写于 作者: M Matthew Wilcox 提交者: Greg Kroah-Hartman

USB: Turn interface_to_usbdev into an inline function

The stronger type-checking would have prevented a bug I had.
Signed-off-by: NMatthew Wilcox <willy@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 fe54b058
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册