aboutsummaryrefslogtreecommitdiffstats
path: root/f2.patch
blob: 6aa21a6ddab2fb737688ebae5264a2cd52d73818 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
From foo@baz Tue Apr  9 12:12:43 2002
Date: Wed, 13 Aug 2008 20:08:35 -0700
To: Greg KH <greg@kroah.com>
From: Greg Kroah-Hartman <gregkh@suse.de>
Subject: USB gadget: make g_util.ko

This moves the "C_UTILS" files in the USB gadget subsystem into a common
kernel module.  This solves a number of kernel build issues (same .o
file being included into multiple .ko, etc.)

Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/gadget/Makefile     |   34 +++++++++++++++++-----------------
 drivers/usb/gadget/composite.c  |   20 ++++++++++++++++++++
 drivers/usb/gadget/config.c     |    5 ++++-
 drivers/usb/gadget/epautoconf.c |    2 ++
 drivers/usb/gadget/usbstring.c  |    2 +-
 5 files changed, 44 insertions(+), 19 deletions(-)

--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -126,6 +126,7 @@ done:
 				function->name, function, value);
 	return value;
 }
+EXPORT_SYMBOL_GPL(usb_add_function);
 
 /**
  * usb_interface_id() - allocate an unused interface ID
@@ -162,6 +163,7 @@ int __init usb_interface_id(struct usb_c
 	}
 	return -ENODEV;
 }
+EXPORT_SYMBOL_GPL(usb_interface_id);
 
 static int config_buf(struct usb_configuration *config,
 		enum usb_device_speed speed, void *buf, u8 type)
@@ -452,6 +454,7 @@ done:
 				config->bConfigurationValue, status);
 	return status;
 }
+EXPORT_SYMBOL_GPL(usb_add_config);
 
 /*-------------------------------------------------------------------------*/
 
@@ -594,6 +597,7 @@ int __init usb_string_id(struct usb_comp
 	}
 	return -ENODEV;
 }
+EXPORT_SYMBOL_GPL(usb_string_id);
 
 /*-------------------------------------------------------------------------*/
 
@@ -1025,6 +1029,7 @@ int __init usb_composite_register(struct
 
 	return usb_gadget_register_driver(&composite_driver);
 }
+EXPORT_SYMBOL_GPL(usb_composite_register);
 
 /**
  * usb_composite_unregister() - unregister a composite driver
@@ -1039,3 +1044,18 @@ void __exit usb_composite_unregister(str
 		return;
 	usb_gadget_unregister_driver(&composite_driver);
 }
+EXPORT_SYMBOL_GPL(usb_composite_unregister);
+
+static int __init composite_init(void)
+{
+	return 0;
+}
+
+static void __exit composite_exit(void)
+{
+}
+
+module_init(composite_init);
+module_exit(composite_exit);
+
+MODULE_LICENSE("GPL");
--- a/drivers/usb/gadget/config.c
+++ b/drivers/usb/gadget/config.c
@@ -61,7 +61,7 @@ usb_descriptor_fillbuf(void *buf, unsign
 	}
 	return dest - (u8 *)buf;
 }
-
+EXPORT_SYMBOL_GPL(usb_descriptor_fillbuf);
 
 /**
  * usb_gadget_config_buf - builts a complete configuration descriptor
@@ -114,6 +114,7 @@ int usb_gadget_config_buf(
 	cp->bmAttributes |= USB_CONFIG_ATT_ONE;
 	return len;
 }
+EXPORT_SYMBOL_GPL(usb_gadget_config_buf);
 
 /**
  * usb_copy_descriptors - copy a vector of USB descriptors
@@ -163,6 +164,7 @@ usb_copy_descriptors(struct usb_descript
 
 	return ret;
 }
+EXPORT_SYMBOL_GPL(usb_copy_descriptors);
 
 /**
  * usb_find_endpoint - find a copy of an endpoint descriptor
@@ -189,3 +191,4 @@ usb_find_endpoint(
 	}
 	return NULL;
 }
+EXPORT_SYMBOL_GPL(usb_find_endpoint);
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -286,6 +286,7 @@ struct usb_ep * __init usb_ep_autoconfig
 	/* Fail */
 	return NULL;
 }
+EXPORT_SYMBOL_GPL(usb_ep_autoconfig);
 
 /**
  * usb_ep_autoconfig_reset - reset endpoint autoconfig state
@@ -308,4 +309,5 @@ void __init usb_ep_autoconfig_reset (str
 #endif
 	epnum = 0;
 }
+EXPORT_SYMBOL_GPL(usb_ep_autoconfig_reset);
 
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -22,30 +22,30 @@ obj-$(CONFIG_USB_M66592)	+= m66592-udc.o
 #
 # USB gadget drivers
 #
-C_UTILS =	composite.o usbstring.o config.o epautoconf.o
 
-g_zero-objs			:= zero.o f_sourcesink.o f_loopback.o $(C_UTILS)
-g_ether-objs			:= ether.o u_ether.o f_subset.o f_ecm.o $(C_UTILS)
-g_serial-objs			:= serial.o u_serial.o f_acm.o f_serial.o $(C_UTILS)
-g_midi-objs			:= gmidi.o usbstring.o config.o epautoconf.o
-gadgetfs-objs			:= inode.o
-g_file_storage-objs		:= file_storage.o usbstring.o config.o \
-					epautoconf.o
-g_printer-objs			:= printer.o usbstring.o config.o \
+g_utils-objs			:= composite.o usbstring.o config.o \
 					epautoconf.o
+
+g_zero-objs			:= zero.o f_sourcesink.o f_loopback.o
+g_ether-objs			:= ether.o u_ether.o f_subset.o f_ecm.o
+g_serial-objs			:= serial.o u_serial.o f_acm.o f_serial.o
+g_midi-objs			:= gmidi.o
+gadgetfs-objs			:= inode.o
+g_file_storage-objs		:= file_storage.o
+g_printer-objs			:= printer.o
 g_cdc-objs			:= cdc2.o u_ether.o f_ecm.o \
-					u_serial.o f_acm.o $(C_UTILS)
+					u_serial.o f_acm.o
 
 ifeq ($(CONFIG_USB_ETH_RNDIS),y)
 	g_ether-objs		+= f_rndis.o rndis.o
 endif
  
-obj-$(CONFIG_USB_ZERO)		+= g_zero.o
-obj-$(CONFIG_USB_ETH)		+= g_ether.o
+obj-$(CONFIG_USB_ZERO)		+= g_zero.o g_utils.o
+obj-$(CONFIG_USB_ETH)		+= g_ether.o g_utils.o
 obj-$(CONFIG_USB_GADGETFS)	+= gadgetfs.o
-obj-$(CONFIG_USB_FILE_STORAGE)	+= g_file_storage.o
-obj-$(CONFIG_USB_G_SERIAL)	+= g_serial.o
-obj-$(CONFIG_USB_G_PRINTER)	+= g_printer.o
-obj-$(CONFIG_USB_MIDI_GADGET)	+= g_midi.o
-obj-$(CONFIG_USB_CDC_COMPOSITE) += g_cdc.o
+obj-$(CONFIG_USB_FILE_STORAGE)	+= g_file_storage.o g_utils.o
+obj-$(CONFIG_USB_G_SERIAL)	+= g_serial.o g_utils.o
+obj-$(CONFIG_USB_G_PRINTER)	+= g_printer.o g_utils.o
+obj-$(CONFIG_USB_MIDI_GADGET)	+= g_midi.o g_utils.o
+obj-$(CONFIG_USB_CDC_COMPOSITE) += g_cdc.o g_utils.o
 
--- a/drivers/usb/gadget/usbstring.c
+++ b/drivers/usb/gadget/usbstring.c
@@ -133,4 +133,4 @@ usb_gadget_get_string (struct usb_gadget
 	buf [1] = USB_DT_STRING;
 	return buf [0];
 }
-
+EXPORT_SYMBOL_GPL(usb_gadget_get_string);