diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2015-03-19 23:34:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-26 05:48:22 -0400 |
commit | bb3247a34257a271b32d43244eabf71198f40ff0 (patch) | |
tree | ded1e31a3996944840b4d9e37e1ee764c4e153cc /drivers/usb/core/usb.c | |
parent | 1da47f54ddaf99d2fa8b4319480d49b88ff5fc2c (diff) |
USB: Move usb_disabled() towards top of the file
Move usb_disabled() and module_param()/core_param() towards the top of the file,
where 'nousb' is defined, as they are all related.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/usb.c')
-rw-r--r-- | drivers/usb/core/usb.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 006951728520..8d5b2f4113cd 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -49,6 +49,22 @@ const char *usbcore_name = "usbcore"; | |||
49 | 49 | ||
50 | static bool nousb; /* Disable USB when built into kernel image */ | 50 | static bool nousb; /* Disable USB when built into kernel image */ |
51 | 51 | ||
52 | /* To disable USB, kernel command line is 'nousb' not 'usbcore.nousb' */ | ||
53 | #ifdef MODULE | ||
54 | module_param(nousb, bool, 0444); | ||
55 | #else | ||
56 | core_param(nousb, nousb, bool, 0444); | ||
57 | #endif | ||
58 | |||
59 | /* | ||
60 | * for external read access to <nousb> | ||
61 | */ | ||
62 | int usb_disabled(void) | ||
63 | { | ||
64 | return nousb; | ||
65 | } | ||
66 | EXPORT_SYMBOL_GPL(usb_disabled); | ||
67 | |||
52 | #ifdef CONFIG_PM | 68 | #ifdef CONFIG_PM |
53 | static int usb_autosuspend_delay = 2; /* Default delay value, | 69 | static int usb_autosuspend_delay = 2; /* Default delay value, |
54 | * in seconds */ | 70 | * in seconds */ |
@@ -964,22 +980,6 @@ void usb_buffer_unmap_sg(const struct usb_device *dev, int is_in, | |||
964 | EXPORT_SYMBOL_GPL(usb_buffer_unmap_sg); | 980 | EXPORT_SYMBOL_GPL(usb_buffer_unmap_sg); |
965 | #endif | 981 | #endif |
966 | 982 | ||
967 | /* To disable USB, kernel command line is 'nousb' not 'usbcore.nousb' */ | ||
968 | #ifdef MODULE | ||
969 | module_param(nousb, bool, 0444); | ||
970 | #else | ||
971 | core_param(nousb, nousb, bool, 0444); | ||
972 | #endif | ||
973 | |||
974 | /* | ||
975 | * for external read access to <nousb> | ||
976 | */ | ||
977 | int usb_disabled(void) | ||
978 | { | ||
979 | return nousb; | ||
980 | } | ||
981 | EXPORT_SYMBOL_GPL(usb_disabled); | ||
982 | |||
983 | /* | 983 | /* |
984 | * Notifications of device and interface registration | 984 | * Notifications of device and interface registration |
985 | */ | 985 | */ |