Merge tag 'for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux...
[deliverable/linux.git] / drivers / usb / core / usb.c
index b1fb9aef0f5b09b10b412c315345637eb3f50a72..8d5b2f4113cd563004acbabb459f4e4212361138 100644 (file)
@@ -49,6 +49,22 @@ const char *usbcore_name = "usbcore";
 
 static bool nousb;     /* Disable USB when built into kernel image */
 
+/* To disable USB, kernel command line is 'nousb' not 'usbcore.nousb' */
+#ifdef MODULE
+module_param(nousb, bool, 0444);
+#else
+core_param(nousb, nousb, bool, 0444);
+#endif
+
+/*
+ * for external read access to <nousb>
+ */
+int usb_disabled(void)
+{
+       return nousb;
+}
+EXPORT_SYMBOL_GPL(usb_disabled);
+
 #ifdef CONFIG_PM
 static int usb_autosuspend_delay = 2;          /* Default delay value,
                                                 * in seconds */
@@ -964,22 +980,6 @@ void usb_buffer_unmap_sg(const struct usb_device *dev, int is_in,
 EXPORT_SYMBOL_GPL(usb_buffer_unmap_sg);
 #endif
 
-/* To disable USB, kernel command line is 'nousb' not 'usbcore.nousb' */
-#ifdef MODULE
-module_param(nousb, bool, 0444);
-#else
-core_param(nousb, nousb, bool, 0444);
-#endif
-
-/*
- * for external read access to <nousb>
- */
-int usb_disabled(void)
-{
-       return nousb;
-}
-EXPORT_SYMBOL_GPL(usb_disabled);
-
 /*
  * Notifications of device and interface registration
  */
@@ -1045,7 +1045,7 @@ static void usb_debugfs_cleanup(void)
 static int __init usb_init(void)
 {
        int retval;
-       if (nousb) {
+       if (usb_disabled()) {
                pr_info("%s: USB support disabled\n", usbcore_name);
                return 0;
        }
@@ -1102,7 +1102,7 @@ out:
 static void __exit usb_exit(void)
 {
        /* This will matter if shutdown/reboot does exitcalls. */
-       if (nousb)
+       if (usb_disabled())
                return;
 
        usb_deregister_device_driver(&usb_generic_driver);
This page took 0.032121 seconds and 5 git commands to generate.