[PATCH] USB: otg hub support is optional
[firefly-linux-kernel-4.4.55.git] / drivers / usb / core / hub.c
index 3c76f7e17c0c4a88f84924c7770d3917c7d9c6ff..0c87f73f29332d9bbf71e688b97acaa5ac4a668f 100644 (file)
@@ -836,6 +836,13 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
        desc = intf->cur_altsetting;
        hdev = interface_to_usbdev(intf);
 
+#ifdef CONFIG_USB_OTG_BLACKLIST_HUB
+       if (hdev->parent) {
+               dev_warn(&intf->dev, "ignoring external hub\n");
+               return -ENODEV;
+       }
+#endif
+
        /* Some hubs have a subclass of 1, which AFAICT according to the */
        /*  specs is not defined, but it works */
        if ((desc->desc.bInterfaceSubClass != 0) &&