Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30b1e495 authored by Yuanhan Liu's avatar Yuanhan Liu Committed by Greg Kroah-Hartman
Browse files

USB: use bus_to_hdc instead of container_of



We defined bus_to_hdc for that, use it.

Signed-off-by: default avatarYuanhan Liu <yliu.null@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 60d80adb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
	}