From: Yuanhan Liu Date: Sat, 6 Oct 2012 07:23:17 +0000 (+0800) Subject: USB: use bus_to_hdc instead of container_of X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=30b1e495b81321f572020a2f5266ece3ed1a6ecd;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git USB: use bus_to_hdc instead of container_of We defined bus_to_hdc for that, use it. Signed-off-by: Yuanhan Liu Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index cd8fb44a3e16..7d3de09a82e4 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -370,14 +370,14 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent, struct usb_bus *bus, unsigned port1) { struct usb_device *dev; - struct usb_hcd *usb_hcd = container_of(bus, struct usb_hcd, self); + struct usb_hcd *usb_hcd = bus_to_hcd(bus); unsigned root_hub = 0; dev = kzalloc(sizeof(*dev), GFP_KERNEL); if (!dev) return NULL; - if (!usb_get_hcd(bus_to_hcd(bus))) { + if (!usb_get_hcd(usb_hcd)) { kfree(dev); return NULL; }