aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/composite.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r--drivers/usb/gadget/composite.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index f9aff1bbcb3e..dd6d1905c148 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -85,7 +85,7 @@ MODULE_PARM_DESC(iSerialNumber, "SerialNumber string");
85 * This function returns the value of the function's bind(), which is 85 * This function returns the value of the function's bind(), which is
86 * zero for success else a negative errno value. 86 * zero for success else a negative errno value.
87 */ 87 */
88int __init usb_add_function(struct usb_configuration *config, 88int usb_add_function(struct usb_configuration *config,
89 struct usb_function *function) 89 struct usb_function *function)
90{ 90{
91 int value = -EINVAL; 91 int value = -EINVAL;
@@ -215,7 +215,7 @@ int usb_function_activate(struct usb_function *function)
215 * Returns the interface ID which was allocated; or -ENODEV if no 215 * Returns the interface ID which was allocated; or -ENODEV if no
216 * more interface IDs can be allocated. 216 * more interface IDs can be allocated.
217 */ 217 */
218int __init usb_interface_id(struct usb_configuration *config, 218int usb_interface_id(struct usb_configuration *config,
219 struct usb_function *function) 219 struct usb_function *function)
220{ 220{
221 unsigned id = config->next_interface_id; 221 unsigned id = config->next_interface_id;
@@ -480,7 +480,7 @@ done:
480 * assigns global resources including string IDs, and per-configuration 480 * assigns global resources including string IDs, and per-configuration
481 * resources such as interface IDs and endpoints. 481 * resources such as interface IDs and endpoints.
482 */ 482 */
483int __init usb_add_config(struct usb_composite_dev *cdev, 483int usb_add_config(struct usb_composite_dev *cdev,
484 struct usb_configuration *config) 484 struct usb_configuration *config)
485{ 485{
486 int status = -EINVAL; 486 int status = -EINVAL;
@@ -677,7 +677,7 @@ static int get_string(struct usb_composite_dev *cdev,
677 * ensure that for example different functions don't wrongly assign 677 * ensure that for example different functions don't wrongly assign
678 * different meanings to the same identifier. 678 * different meanings to the same identifier.
679 */ 679 */
680int __init usb_string_id(struct usb_composite_dev *cdev) 680int usb_string_id(struct usb_composite_dev *cdev)
681{ 681{
682 if (cdev->next_string_id < 254) { 682 if (cdev->next_string_id < 254) {
683 /* string id 0 is reserved */ 683 /* string id 0 is reserved */
@@ -910,7 +910,7 @@ static ssize_t composite_show_suspended(struct device *dev,
910 910
911static DEVICE_ATTR(suspended, 0444, composite_show_suspended, NULL); 911static DEVICE_ATTR(suspended, 0444, composite_show_suspended, NULL);
912 912
913static void /* __init_or_exit */ 913static void
914composite_unbind(struct usb_gadget *gadget) 914composite_unbind(struct usb_gadget *gadget)
915{ 915{
916 struct usb_composite_dev *cdev = get_gadget_data(gadget); 916 struct usb_composite_dev *cdev = get_gadget_data(gadget);
@@ -960,7 +960,7 @@ composite_unbind(struct usb_gadget *gadget)
960 composite = NULL; 960 composite = NULL;
961} 961}
962 962
963static void __init 963static void
964string_override_one(struct usb_gadget_strings *tab, u8 id, const char *s) 964string_override_one(struct usb_gadget_strings *tab, u8 id, const char *s)
965{ 965{
966 struct usb_string *str = tab->strings; 966 struct usb_string *str = tab->strings;
@@ -973,7 +973,7 @@ string_override_one(struct usb_gadget_strings *tab, u8 id, const char *s)
973 } 973 }
974} 974}
975 975
976static void __init 976static void
977string_override(struct usb_gadget_strings **tab, u8 id, const char *s) 977string_override(struct usb_gadget_strings **tab, u8 id, const char *s)
978{ 978{
979 while (*tab) { 979 while (*tab) {
@@ -982,7 +982,7 @@ string_override(struct usb_gadget_strings **tab, u8 id, const char *s)
982 } 982 }
983} 983}
984 984
985static int __init composite_bind(struct usb_gadget *gadget) 985static int composite_bind(struct usb_gadget *gadget)
986{ 986{
987 struct usb_composite_dev *cdev; 987 struct usb_composite_dev *cdev;
988 int status = -ENOMEM; 988 int status = -ENOMEM;
@@ -1113,7 +1113,6 @@ static struct usb_gadget_driver composite_driver = {
1113 .speed = USB_SPEED_HIGH, 1113 .speed = USB_SPEED_HIGH,
1114 1114
1115 .bind = composite_bind, 1115 .bind = composite_bind,
1116 /* .unbind = __exit_p(composite_unbind), */
1117 .unbind = composite_unbind, 1116 .unbind = composite_unbind,
1118 1117
1119 .setup = composite_setup, 1118 .setup = composite_setup,
@@ -1142,7 +1141,7 @@ static struct usb_gadget_driver composite_driver = {
1142 * while it was binding. That would usually be done in order to wait for 1141 * while it was binding. That would usually be done in order to wait for
1143 * some userspace participation. 1142 * some userspace participation.
1144 */ 1143 */
1145int __init usb_composite_register(struct usb_composite_driver *driver) 1144int usb_composite_register(struct usb_composite_driver *driver)
1146{ 1145{
1147 if (!driver || !driver->dev || !driver->bind || composite) 1146 if (!driver || !driver->dev || !driver->bind || composite)
1148 return -EINVAL; 1147 return -EINVAL;
@@ -1163,7 +1162,7 @@ int __init usb_composite_register(struct usb_composite_driver *driver)
1163 * This function is used to unregister drivers using the composite 1162 * This function is used to unregister drivers using the composite
1164 * driver framework. 1163 * driver framework.
1165 */ 1164 */
1166void /* __exit */ usb_composite_unregister(struct usb_composite_driver *driver) 1165void usb_composite_unregister(struct usb_composite_driver *driver)
1167{ 1166{
1168 if (composite != driver) 1167 if (composite != driver)
1169 return; 1168 return;