Commit fa25f0e6 authored by Oliver Neukum's avatar Oliver Neukum Committed by Luis Henriques

xhci: refuse loading if nousb is used

commit 1eaf35e4 upstream.

The module should fail to load.
Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
[ luis: backported to 3.16:
  - moved usb_disabled() check to the top of the function so that there's
    no need to invoke xhci_unregister_pci() before returning.  Suggested
    by gregkh. ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 133742f9
......@@ -4928,6 +4928,9 @@ static int __init xhci_hcd_init(void)
{
int retval;
if (usb_disabled())
return -ENODEV;
retval = xhci_register_pci();
if (retval < 0) {
pr_debug("Problem registering PCI driver.\n");
......@@ -4955,6 +4958,7 @@ static int __init xhci_hcd_init(void)
BUILD_BUG_ON(sizeof(struct xhci_intr_reg) != 8*32/8);
/* xhci_run_regs has eight fields and embeds 128 xhci_intr_regs */
BUILD_BUG_ON(sizeof(struct xhci_run_regs) != (8+8*128)*32/8);
return 0;
unreg_pci:
xhci_unregister_pci();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment