aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/acm_ms.c3
-rw-r--r--drivers/usb/gadget/audio.c3
-rw-r--r--drivers/usb/gadget/cdc2.c3
-rw-r--r--drivers/usb/gadget/composite.c9
-rw-r--r--drivers/usb/gadget/ether.c3
-rw-r--r--drivers/usb/gadget/g_ffs.c3
-rw-r--r--drivers/usb/gadget/gmidi.c3
-rw-r--r--drivers/usb/gadget/hid.c3
-rw-r--r--drivers/usb/gadget/mass_storage.c3
-rw-r--r--drivers/usb/gadget/multi.c3
-rw-r--r--drivers/usb/gadget/ncm.c3
-rw-r--r--drivers/usb/gadget/nokia.c3
-rw-r--r--drivers/usb/gadget/printer.c3
-rw-r--r--drivers/usb/gadget/serial.c3
-rw-r--r--drivers/usb/gadget/tcm_usb_gadget.c3
-rw-r--r--drivers/usb/gadget/webcam.c3
-rw-r--r--drivers/usb/gadget/zero.c3
17 files changed, 34 insertions, 23 deletions
diff --git a/drivers/usb/gadget/acm_ms.c b/drivers/usb/gadget/acm_ms.c
index dc5cd51de7d4..65a2f3cbcde3 100644
--- a/drivers/usb/gadget/acm_ms.c
+++ b/drivers/usb/gadget/acm_ms.c
@@ -237,6 +237,7 @@ static __refdata struct usb_composite_driver acm_ms_driver = {
237 .dev = &device_desc, 237 .dev = &device_desc,
238 .max_speed = USB_SPEED_SUPER, 238 .max_speed = USB_SPEED_SUPER,
239 .strings = dev_strings, 239 .strings = dev_strings,
240 .bind = acm_ms_bind,
240 .unbind = __exit_p(acm_ms_unbind), 241 .unbind = __exit_p(acm_ms_unbind),
241}; 242};
242 243
@@ -246,7 +247,7 @@ MODULE_LICENSE("GPL v2");
246 247
247static int __init init(void) 248static int __init init(void)
248{ 249{
249 return usb_composite_probe(&acm_ms_driver, acm_ms_bind); 250 return usb_composite_probe(&acm_ms_driver);
250} 251}
251module_init(init); 252module_init(init);
252 253
diff --git a/drivers/usb/gadget/audio.c b/drivers/usb/gadget/audio.c
index e539490e7733..dd339bc5b40c 100644
--- a/drivers/usb/gadget/audio.c
+++ b/drivers/usb/gadget/audio.c
@@ -203,12 +203,13 @@ static __refdata struct usb_composite_driver audio_driver = {
203 .dev = &device_desc, 203 .dev = &device_desc,
204 .strings = audio_strings, 204 .strings = audio_strings,
205 .max_speed = USB_SPEED_HIGH, 205 .max_speed = USB_SPEED_HIGH,
206 .bind = audio_bind,
206 .unbind = __exit_p(audio_unbind), 207 .unbind = __exit_p(audio_unbind),
207}; 208};
208 209
209static int __init init(void) 210static int __init init(void)
210{ 211{
211 return usb_composite_probe(&audio_driver, audio_bind); 212 return usb_composite_probe(&audio_driver);
212} 213}
213module_init(init); 214module_init(init);
214 215
diff --git a/drivers/usb/gadget/cdc2.c b/drivers/usb/gadget/cdc2.c
index 00b65ac7a2ef..b7d984b54ca9 100644
--- a/drivers/usb/gadget/cdc2.c
+++ b/drivers/usb/gadget/cdc2.c
@@ -237,6 +237,7 @@ static __refdata struct usb_composite_driver cdc_driver = {
237 .dev = &device_desc, 237 .dev = &device_desc,
238 .strings = dev_strings, 238 .strings = dev_strings,
239 .max_speed = USB_SPEED_HIGH, 239 .max_speed = USB_SPEED_HIGH,
240 .bind = cdc_bind,
240 .unbind = __exit_p(cdc_unbind), 241 .unbind = __exit_p(cdc_unbind),
241}; 242};
242 243
@@ -246,7 +247,7 @@ MODULE_LICENSE("GPL");
246 247
247static int __init init(void) 248static int __init init(void)
248{ 249{
249 return usb_composite_probe(&cdc_driver, cdc_bind); 250 return usb_composite_probe(&cdc_driver);
250} 251}
251module_init(init); 252module_init(init);
252 253
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 402e5bd8b3e5..071d15c44116 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1617,12 +1617,9 @@ static struct usb_gadget_driver composite_driver = {
1617 * while it was binding. That would usually be done in order to wait for 1617 * while it was binding. That would usually be done in order to wait for
1618 * some userspace participation. 1618 * some userspace participation.
1619 */ 1619 */
1620int usb_composite_probe(struct usb_composite_driver *driver, 1620int usb_composite_probe(struct usb_composite_driver *driver)
1621 int (*bind)(struct usb_composite_dev *cdev))
1622{ 1621{
1623 if (!driver || !driver->dev || composite) 1622 if (!driver || !driver->dev || composite || !driver->bind)
1624 return -EINVAL;
1625 if (!bind && !driver->bind)
1626 return -EINVAL; 1623 return -EINVAL;
1627 1624
1628 if (!driver->name) 1625 if (!driver->name)
@@ -1633,8 +1630,6 @@ int usb_composite_probe(struct usb_composite_driver *driver,
1633 composite_driver.driver.name = driver->name; 1630 composite_driver.driver.name = driver->name;
1634 composite_driver.max_speed = driver->max_speed; 1631 composite_driver.max_speed = driver->max_speed;
1635 composite = driver; 1632 composite = driver;
1636 if (!driver->bind)
1637 driver->bind = bind;
1638 1633
1639 return usb_gadget_probe_driver(&composite_driver, composite_bind); 1634 return usb_gadget_probe_driver(&composite_driver, composite_bind);
1640} 1635}
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 49a7dac06b1d..4580ec09cc53 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -393,6 +393,7 @@ static __refdata struct usb_composite_driver eth_driver = {
393 .dev = &device_desc, 393 .dev = &device_desc,
394 .strings = dev_strings, 394 .strings = dev_strings,
395 .max_speed = USB_SPEED_SUPER, 395 .max_speed = USB_SPEED_SUPER,
396 .bind = eth_bind,
396 .unbind = __exit_p(eth_unbind), 397 .unbind = __exit_p(eth_unbind),
397}; 398};
398 399
@@ -402,7 +403,7 @@ MODULE_LICENSE("GPL");
402 403
403static int __init init(void) 404static int __init init(void)
404{ 405{
405 return usb_composite_probe(&eth_driver, eth_bind); 406 return usb_composite_probe(&eth_driver);
406} 407}
407module_init(init); 408module_init(init);
408 409
diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c
index d1312c404afa..da9809f55cb5 100644
--- a/drivers/usb/gadget/g_ffs.c
+++ b/drivers/usb/gadget/g_ffs.c
@@ -168,6 +168,7 @@ static __refdata struct usb_composite_driver gfs_driver = {
168 .dev = &gfs_dev_desc, 168 .dev = &gfs_dev_desc,
169 .strings = gfs_dev_strings, 169 .strings = gfs_dev_strings,
170 .max_speed = USB_SPEED_HIGH, 170 .max_speed = USB_SPEED_HIGH,
171 .bind = gfs_bind,
171 .unbind = gfs_unbind, 172 .unbind = gfs_unbind,
172 .iProduct = DRIVER_DESC, 173 .iProduct = DRIVER_DESC,
173}; 174};
@@ -268,7 +269,7 @@ static int functionfs_ready_callback(struct ffs_data *ffs)
268 } 269 }
269 gfs_registered = true; 270 gfs_registered = true;
270 271
271 ret = usb_composite_probe(&gfs_driver, gfs_bind); 272 ret = usb_composite_probe(&gfs_driver);
272 if (unlikely(ret < 0)) 273 if (unlikely(ret < 0))
273 gfs_registered = false; 274 gfs_registered = false;
274 275
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c
index ae46f69b718a..1e3cd378a2d7 100644
--- a/drivers/usb/gadget/gmidi.c
+++ b/drivers/usb/gadget/gmidi.c
@@ -189,12 +189,13 @@ static __refdata struct usb_composite_driver midi_driver = {
189 .dev = &device_desc, 189 .dev = &device_desc,
190 .strings = dev_strings, 190 .strings = dev_strings,
191 .max_speed = USB_SPEED_HIGH, 191 .max_speed = USB_SPEED_HIGH,
192 .bind = midi_bind,
192 .unbind = __exit_p(midi_unbind), 193 .unbind = __exit_p(midi_unbind),
193}; 194};
194 195
195static int __init midi_init(void) 196static int __init midi_init(void)
196{ 197{
197 return usb_composite_probe(&midi_driver, midi_bind); 198 return usb_composite_probe(&midi_driver);
198} 199}
199module_init(midi_init); 200module_init(midi_init);
200 201
diff --git a/drivers/usb/gadget/hid.c b/drivers/usb/gadget/hid.c
index 34e139e700b4..8502e56d73bc 100644
--- a/drivers/usb/gadget/hid.c
+++ b/drivers/usb/gadget/hid.c
@@ -247,6 +247,7 @@ static __refdata struct usb_composite_driver hidg_driver = {
247 .dev = &device_desc, 247 .dev = &device_desc,
248 .strings = dev_strings, 248 .strings = dev_strings,
249 .max_speed = USB_SPEED_HIGH, 249 .max_speed = USB_SPEED_HIGH,
250 .bind = hid_bind,
250 .unbind = __exit_p(hid_unbind), 251 .unbind = __exit_p(hid_unbind),
251}; 252};
252 253
@@ -272,7 +273,7 @@ static int __init hidg_init(void)
272 if (status < 0) 273 if (status < 0)
273 return status; 274 return status;
274 275
275 status = usb_composite_probe(&hidg_driver, hid_bind); 276 status = usb_composite_probe(&hidg_driver);
276 if (status < 0) 277 if (status < 0)
277 platform_driver_unregister(&hidg_plat_driver); 278 platform_driver_unregister(&hidg_plat_driver);
278 279
diff --git a/drivers/usb/gadget/mass_storage.c b/drivers/usb/gadget/mass_storage.c
index 5df117e3f78d..480edbc368e5 100644
--- a/drivers/usb/gadget/mass_storage.c
+++ b/drivers/usb/gadget/mass_storage.c
@@ -162,6 +162,7 @@ static __refdata struct usb_composite_driver msg_driver = {
162 .iProduct = DRIVER_DESC, 162 .iProduct = DRIVER_DESC,
163 .max_speed = USB_SPEED_SUPER, 163 .max_speed = USB_SPEED_SUPER,
164 .needs_serial = 1, 164 .needs_serial = 1,
165 .bind = msg_bind,
165}; 166};
166 167
167MODULE_DESCRIPTION(DRIVER_DESC); 168MODULE_DESCRIPTION(DRIVER_DESC);
@@ -170,7 +171,7 @@ MODULE_LICENSE("GPL");
170 171
171static int __init msg_init(void) 172static int __init msg_init(void)
172{ 173{
173 return usb_composite_probe(&msg_driver, msg_bind); 174 return usb_composite_probe(&msg_driver);
174} 175}
175module_init(msg_init); 176module_init(msg_init);
176 177
diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c
index 7e5852a28a93..13db7ccb9571 100644
--- a/drivers/usb/gadget/multi.c
+++ b/drivers/usb/gadget/multi.c
@@ -343,6 +343,7 @@ static __refdata struct usb_composite_driver multi_driver = {
343 .dev = &device_desc, 343 .dev = &device_desc,
344 .strings = dev_strings, 344 .strings = dev_strings,
345 .max_speed = USB_SPEED_HIGH, 345 .max_speed = USB_SPEED_HIGH,
346 .bind = multi_bind,
346 .unbind = __exit_p(multi_unbind), 347 .unbind = __exit_p(multi_unbind),
347 .iProduct = DRIVER_DESC, 348 .iProduct = DRIVER_DESC,
348 .needs_serial = 1, 349 .needs_serial = 1,
@@ -351,7 +352,7 @@ static __refdata struct usb_composite_driver multi_driver = {
351 352
352static int __init multi_init(void) 353static int __init multi_init(void)
353{ 354{
354 return usb_composite_probe(&multi_driver, multi_bind); 355 return usb_composite_probe(&multi_driver);
355} 356}
356module_init(multi_init); 357module_init(multi_init);
357 358
diff --git a/drivers/usb/gadget/ncm.c b/drivers/usb/gadget/ncm.c
index 5079bf659e31..9a20057896cd 100644
--- a/drivers/usb/gadget/ncm.c
+++ b/drivers/usb/gadget/ncm.c
@@ -220,6 +220,7 @@ static __refdata struct usb_composite_driver ncm_driver = {
220 .dev = &device_desc, 220 .dev = &device_desc,
221 .strings = dev_strings, 221 .strings = dev_strings,
222 .max_speed = USB_SPEED_HIGH, 222 .max_speed = USB_SPEED_HIGH,
223 .bind = gncm_bind,
223 .unbind = __exit_p(gncm_unbind), 224 .unbind = __exit_p(gncm_unbind),
224}; 225};
225 226
@@ -229,7 +230,7 @@ MODULE_LICENSE("GPL");
229 230
230static int __init init(void) 231static int __init init(void)
231{ 232{
232 return usb_composite_probe(&ncm_driver, gncm_bind); 233 return usb_composite_probe(&ncm_driver);
233} 234}
234module_init(init); 235module_init(init);
235 236
diff --git a/drivers/usb/gadget/nokia.c b/drivers/usb/gadget/nokia.c
index 936d0afc4527..a5b5e7162fef 100644
--- a/drivers/usb/gadget/nokia.c
+++ b/drivers/usb/gadget/nokia.c
@@ -242,12 +242,13 @@ static __refdata struct usb_composite_driver nokia_driver = {
242 .dev = &device_desc, 242 .dev = &device_desc,
243 .strings = dev_strings, 243 .strings = dev_strings,
244 .max_speed = USB_SPEED_HIGH, 244 .max_speed = USB_SPEED_HIGH,
245 .bind = nokia_bind,
245 .unbind = __exit_p(nokia_unbind), 246 .unbind = __exit_p(nokia_unbind),
246}; 247};
247 248
248static int __init nokia_init(void) 249static int __init nokia_init(void)
249{ 250{
250 return usb_composite_probe(&nokia_driver, nokia_bind); 251 return usb_composite_probe(&nokia_driver);
251} 252}
252module_init(nokia_init); 253module_init(nokia_init);
253 254
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c
index 0aab51766ce6..33c0c07493e8 100644
--- a/drivers/usb/gadget/printer.c
+++ b/drivers/usb/gadget/printer.c
@@ -1274,6 +1274,7 @@ static __refdata struct usb_composite_driver printer_driver = {
1274 .dev = &device_desc, 1274 .dev = &device_desc,
1275 .strings = dev_strings, 1275 .strings = dev_strings,
1276 .max_speed = USB_SPEED_HIGH, 1276 .max_speed = USB_SPEED_HIGH,
1277 .bind = printer_bind,
1277 .unbind = printer_unbind, 1278 .unbind = printer_unbind,
1278}; 1279};
1279 1280
@@ -1297,7 +1298,7 @@ init(void)
1297 return status; 1298 return status;
1298 } 1299 }
1299 1300
1300 status = usb_composite_probe(&printer_driver, printer_bind); 1301 status = usb_composite_probe(&printer_driver);
1301 if (status) { 1302 if (status) {
1302 class_destroy(usb_gadget_class); 1303 class_destroy(usb_gadget_class);
1303 unregister_chrdev_region(g_printer_devno, 1); 1304 unregister_chrdev_region(g_printer_devno, 1);
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index 7b0b6f40ed07..ea3f8e9344ae 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -243,6 +243,7 @@ static __refdata struct usb_composite_driver gserial_driver = {
243 .dev = &device_desc, 243 .dev = &device_desc,
244 .strings = dev_strings, 244 .strings = dev_strings,
245 .max_speed = USB_SPEED_SUPER, 245 .max_speed = USB_SPEED_SUPER,
246 .bind = gs_bind,
246}; 247};
247 248
248static int __init init(void) 249static int __init init(void)
@@ -271,7 +272,7 @@ static int __init init(void)
271 } 272 }
272 strings_dev[STRING_DESCRIPTION_IDX].s = serial_config_driver.label; 273 strings_dev[STRING_DESCRIPTION_IDX].s = serial_config_driver.label;
273 274
274 return usb_composite_probe(&gserial_driver, gs_bind); 275 return usb_composite_probe(&gserial_driver);
275} 276}
276module_init(init); 277module_init(init);
277 278
diff --git a/drivers/usb/gadget/tcm_usb_gadget.c b/drivers/usb/gadget/tcm_usb_gadget.c
index 28fef844a06a..35ca09af9b4a 100644
--- a/drivers/usb/gadget/tcm_usb_gadget.c
+++ b/drivers/usb/gadget/tcm_usb_gadget.c
@@ -2441,12 +2441,13 @@ static __refdata struct usb_composite_driver usbg_driver = {
2441 .dev = &usbg_device_desc, 2441 .dev = &usbg_device_desc,
2442 .strings = usbg_strings, 2442 .strings = usbg_strings,
2443 .max_speed = USB_SPEED_SUPER, 2443 .max_speed = USB_SPEED_SUPER,
2444 .bind = usb_target_bind,
2444 .unbind = guas_unbind, 2445 .unbind = guas_unbind,
2445}; 2446};
2446 2447
2447static int usbg_attach(struct usbg_tpg *tpg) 2448static int usbg_attach(struct usbg_tpg *tpg)
2448{ 2449{
2449 return usb_composite_probe(&usbg_driver, usb_target_bind); 2450 return usb_composite_probe(&usbg_driver);
2450} 2451}
2451 2452
2452static void usbg_detach(struct usbg_tpg *tpg) 2453static void usbg_detach(struct usbg_tpg *tpg)
diff --git a/drivers/usb/gadget/webcam.c b/drivers/usb/gadget/webcam.c
index d946f19482e8..2a617c3f5a40 100644
--- a/drivers/usb/gadget/webcam.c
+++ b/drivers/usb/gadget/webcam.c
@@ -395,13 +395,14 @@ static __refdata struct usb_composite_driver webcam_driver = {
395 .dev = &webcam_device_descriptor, 395 .dev = &webcam_device_descriptor,
396 .strings = webcam_device_strings, 396 .strings = webcam_device_strings,
397 .max_speed = USB_SPEED_SUPER, 397 .max_speed = USB_SPEED_SUPER,
398 .bind = webcam_bind,
398 .unbind = webcam_unbind, 399 .unbind = webcam_unbind,
399}; 400};
400 401
401static int __init 402static int __init
402webcam_init(void) 403webcam_init(void)
403{ 404{
404 return usb_composite_probe(&webcam_driver, webcam_bind); 405 return usb_composite_probe(&webcam_driver);
405} 406}
406 407
407static void __exit 408static void __exit
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
index 5db33cbe755b..90df613cccc0 100644
--- a/drivers/usb/gadget/zero.c
+++ b/drivers/usb/gadget/zero.c
@@ -339,6 +339,7 @@ static __refdata struct usb_composite_driver zero_driver = {
339 .dev = &device_desc, 339 .dev = &device_desc,
340 .strings = dev_strings, 340 .strings = dev_strings,
341 .max_speed = USB_SPEED_SUPER, 341 .max_speed = USB_SPEED_SUPER,
342 .bind = zero_bind,
342 .unbind = zero_unbind, 343 .unbind = zero_unbind,
343 .suspend = zero_suspend, 344 .suspend = zero_suspend,
344 .resume = zero_resume, 345 .resume = zero_resume,
@@ -349,7 +350,7 @@ MODULE_LICENSE("GPL");
349 350
350static int __init init(void) 351static int __init init(void)
351{ 352{
352 return usb_composite_probe(&zero_driver, zero_bind); 353 return usb_composite_probe(&zero_driver);
353} 354}
354module_init(init); 355module_init(init);
355 356