diff options
Diffstat (limited to 'drivers/usb/serial/ipaq.c')
-rw-r--r-- | drivers/usb/serial/ipaq.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index 9840bade79f9..bfc6998cd16f 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c | |||
@@ -652,11 +652,6 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) | |||
652 | port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE; | 652 | port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE; |
653 | 653 | ||
654 | msleep(1000*initial_wait); | 654 | msleep(1000*initial_wait); |
655 | /* Start reading from the device */ | ||
656 | usb_fill_bulk_urb(port->read_urb, serial->dev, | ||
657 | usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), | ||
658 | port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, | ||
659 | ipaq_read_bulk_callback, port); | ||
660 | 655 | ||
661 | /* | 656 | /* |
662 | * Send out control message observed in win98 sniffs. Not sure what | 657 | * Send out control message observed in win98 sniffs. Not sure what |
@@ -670,18 +665,31 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) | |||
670 | result = usb_control_msg(serial->dev, | 665 | result = usb_control_msg(serial->dev, |
671 | usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21, | 666 | usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21, |
672 | 0x1, 0, NULL, 0, 100); | 667 | 0x1, 0, NULL, 0, 100); |
673 | if (result == 0) { | 668 | if (!result) |
674 | result = usb_submit_urb(port->read_urb, GFP_KERNEL); | 669 | break; |
675 | if (result) { | 670 | |
676 | err("%s - failed submitting read urb, error %d", __FUNCTION__, result); | ||
677 | goto error; | ||
678 | } | ||
679 | return 0; | ||
680 | } | ||
681 | msleep(1000); | 671 | msleep(1000); |
682 | } | 672 | } |
683 | err("%s - failed doing control urb, error %d", __FUNCTION__, result); | 673 | |
684 | goto error; | 674 | if (!retries && result) { |
675 | err("%s - failed doing control urb, error %d", __FUNCTION__, | ||
676 | result); | ||
677 | goto error; | ||
678 | } | ||
679 | |||
680 | /* Start reading from the device */ | ||
681 | usb_fill_bulk_urb(port->read_urb, serial->dev, | ||
682 | usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), | ||
683 | port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, | ||
684 | ipaq_read_bulk_callback, port); | ||
685 | |||
686 | result = usb_submit_urb(port->read_urb, GFP_KERNEL); | ||
687 | if (result) { | ||
688 | err("%s - failed submitting read urb, error %d", __FUNCTION__, result); | ||
689 | goto error; | ||
690 | } | ||
691 | |||
692 | return 0; | ||
685 | 693 | ||
686 | enomem: | 694 | enomem: |
687 | result = -ENOMEM; | 695 | result = -ENOMEM; |