diff options
author | Yuanhan Liu <yliu.null@gmail.com> | 2012-10-06 03:23:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-24 17:40:50 -0400 |
commit | 30b1e495b81321f572020a2f5266ece3ed1a6ecd (patch) | |
tree | d872d1aa3a13a893c3a2ca4dfe5c25159741ebe9 /drivers/usb/core | |
parent | 60d80adbac9b7492439b1d0665353bc2117b4d78 (diff) |
USB: use bus_to_hdc instead of container_of
We defined bus_to_hdc for that, use it.
Signed-off-by: Yuanhan Liu <yliu.null@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/usb.c | 4 |
1 files changed, 2 insertions, 2 deletions
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, | |||
370 | struct usb_bus *bus, unsigned port1) | 370 | struct usb_bus *bus, unsigned port1) |
371 | { | 371 | { |
372 | struct usb_device *dev; | 372 | struct usb_device *dev; |
373 | struct usb_hcd *usb_hcd = container_of(bus, struct usb_hcd, self); | 373 | struct usb_hcd *usb_hcd = bus_to_hcd(bus); |
374 | unsigned root_hub = 0; | 374 | unsigned root_hub = 0; |
375 | 375 | ||
376 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | 376 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
377 | if (!dev) | 377 | if (!dev) |
378 | return NULL; | 378 | return NULL; |
379 | 379 | ||
380 | if (!usb_get_hcd(bus_to_hcd(bus))) { | 380 | if (!usb_get_hcd(usb_hcd)) { |
381 | kfree(dev); | 381 | kfree(dev); |
382 | return NULL; | 382 | return NULL; |
383 | } | 383 | } |