mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
60d80adbac
commit
30b1e495b8
1 changed files with 2 additions and 2 deletions
|
@ -370,14 +370,14 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
|
||||||
struct usb_bus *bus, unsigned port1)
|
struct usb_bus *bus, unsigned port1)
|
||||||
{
|
{
|
||||||
struct usb_device *dev;
|
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;
|
unsigned root_hub = 0;
|
||||||
|
|
||||||
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
|
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!usb_get_hcd(bus_to_hcd(bus))) {
|
if (!usb_get_hcd(usb_hcd)) {
|
||||||
kfree(dev);
|
kfree(dev);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue