From: Oliver Neukum Date: Thu, 3 Dec 2015 14:03:34 +0000 (+0100) Subject: xhci: refuse loading if nousb is used X-Git-Tag: v3.2.77~78 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=bc53b1e234987f0f14a02969bf3ed348ec077c56 xhci: refuse loading if nousb is used commit 1eaf35e4dd592c59041bc1ed3248c46326da1f5f upstream. The module should fail to load. Signed-off-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman [bwh: Backported to 3.2: xhci_hcd_init() registers the PCI driver, so check before doing that rather than at the end of the function] Signed-off-by: Ben Hutchings --- diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index d7ddb5a064d9..a1f90c7fb564 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4300,6 +4300,9 @@ static int __init xhci_hcd_init(void) { int retval; + if (usb_disabled()) + return -ENODEV; + retval = xhci_register_pci(); if (retval < 0) { printk(KERN_DEBUG "Problem registering PCI driver.");