diff options
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 183b41753c98..62f4fb9b362f 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -1301,10 +1301,6 @@ made_compressed_probe: | |||
1301 | tty_port_init(&acm->port); | 1301 | tty_port_init(&acm->port); |
1302 | acm->port.ops = &acm_port_ops; | 1302 | acm->port.ops = &acm_port_ops; |
1303 | 1303 | ||
1304 | minor = acm_alloc_minor(acm); | ||
1305 | if (minor < 0) | ||
1306 | goto alloc_fail1; | ||
1307 | |||
1308 | ctrlsize = usb_endpoint_maxp(epctrl); | 1304 | ctrlsize = usb_endpoint_maxp(epctrl); |
1309 | readsize = usb_endpoint_maxp(epread) * | 1305 | readsize = usb_endpoint_maxp(epread) * |
1310 | (quirks == SINGLE_RX_URB ? 1 : 2); | 1306 | (quirks == SINGLE_RX_URB ? 1 : 2); |
@@ -1312,6 +1308,13 @@ made_compressed_probe: | |||
1312 | acm->writesize = usb_endpoint_maxp(epwrite) * 20; | 1308 | acm->writesize = usb_endpoint_maxp(epwrite) * 20; |
1313 | acm->control = control_interface; | 1309 | acm->control = control_interface; |
1314 | acm->data = data_interface; | 1310 | acm->data = data_interface; |
1311 | |||
1312 | usb_get_intf(acm->control); /* undone in destruct() */ | ||
1313 | |||
1314 | minor = acm_alloc_minor(acm); | ||
1315 | if (minor < 0) | ||
1316 | goto alloc_fail1; | ||
1317 | |||
1315 | acm->minor = minor; | 1318 | acm->minor = minor; |
1316 | acm->dev = usb_dev; | 1319 | acm->dev = usb_dev; |
1317 | if (h.usb_cdc_acm_descriptor) | 1320 | if (h.usb_cdc_acm_descriptor) |
@@ -1458,7 +1461,6 @@ skip_countries: | |||
1458 | usb_driver_claim_interface(&acm_driver, data_interface, acm); | 1461 | usb_driver_claim_interface(&acm_driver, data_interface, acm); |
1459 | usb_set_intfdata(data_interface, acm); | 1462 | usb_set_intfdata(data_interface, acm); |
1460 | 1463 | ||
1461 | usb_get_intf(control_interface); | ||
1462 | tty_dev = tty_port_register_device(&acm->port, acm_tty_driver, minor, | 1464 | tty_dev = tty_port_register_device(&acm->port, acm_tty_driver, minor, |
1463 | &control_interface->dev); | 1465 | &control_interface->dev); |
1464 | if (IS_ERR(tty_dev)) { | 1466 | if (IS_ERR(tty_dev)) { |