diff options
Diffstat (limited to 'drivers/usb/serial/pl2303.c')
-rw-r--r-- | drivers/usb/serial/pl2303.c | 117 |
1 files changed, 58 insertions, 59 deletions
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 2af778555bdc..c605fb68f807 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c | |||
@@ -410,7 +410,7 @@ static int set_control_lines(struct usb_device *dev, u8 value) | |||
410 | retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), | 410 | retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), |
411 | SET_CONTROL_REQUEST, SET_CONTROL_REQUEST_TYPE, | 411 | SET_CONTROL_REQUEST, SET_CONTROL_REQUEST_TYPE, |
412 | value, 0, NULL, 0, 100); | 412 | value, 0, NULL, 0, 100); |
413 | dbg("%s - value = %d, retval = %d", __FUNCTION__, value, retval); | 413 | dbg("%s - value = %d, retval = %d", __func__, value, retval); |
414 | return retval; | 414 | return retval; |
415 | } | 415 | } |
416 | 416 | ||
@@ -420,7 +420,7 @@ static void pl2303_send(struct usb_serial_port *port) | |||
420 | struct pl2303_private *priv = usb_get_serial_port_data(port); | 420 | struct pl2303_private *priv = usb_get_serial_port_data(port); |
421 | unsigned long flags; | 421 | unsigned long flags; |
422 | 422 | ||
423 | dbg("%s - port %d", __FUNCTION__, port->number); | 423 | dbg("%s - port %d", __func__, port->number); |
424 | 424 | ||
425 | spin_lock_irqsave(&priv->lock, flags); | 425 | spin_lock_irqsave(&priv->lock, flags); |
426 | 426 | ||
@@ -441,7 +441,7 @@ static void pl2303_send(struct usb_serial_port *port) | |||
441 | 441 | ||
442 | spin_unlock_irqrestore(&priv->lock, flags); | 442 | spin_unlock_irqrestore(&priv->lock, flags); |
443 | 443 | ||
444 | usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, | 444 | usb_serial_debug_data(debug, &port->dev, __func__, count, |
445 | port->write_urb->transfer_buffer); | 445 | port->write_urb->transfer_buffer); |
446 | 446 | ||
447 | port->write_urb->transfer_buffer_length = count; | 447 | port->write_urb->transfer_buffer_length = count; |
@@ -449,7 +449,7 @@ static void pl2303_send(struct usb_serial_port *port) | |||
449 | result = usb_submit_urb(port->write_urb, GFP_ATOMIC); | 449 | result = usb_submit_urb(port->write_urb, GFP_ATOMIC); |
450 | if (result) { | 450 | if (result) { |
451 | dev_err(&port->dev, "%s - failed submitting write urb," | 451 | dev_err(&port->dev, "%s - failed submitting write urb," |
452 | " error %d\n", __FUNCTION__, result); | 452 | " error %d\n", __func__, result); |
453 | priv->write_urb_in_use = 0; | 453 | priv->write_urb_in_use = 0; |
454 | // TODO: reschedule pl2303_send | 454 | // TODO: reschedule pl2303_send |
455 | } | 455 | } |
@@ -463,7 +463,7 @@ static int pl2303_write(struct usb_serial_port *port, const unsigned char *buf, | |||
463 | struct pl2303_private *priv = usb_get_serial_port_data(port); | 463 | struct pl2303_private *priv = usb_get_serial_port_data(port); |
464 | unsigned long flags; | 464 | unsigned long flags; |
465 | 465 | ||
466 | dbg("%s - port %d, %d bytes", __FUNCTION__, port->number, count); | 466 | dbg("%s - port %d, %d bytes", __func__, port->number, count); |
467 | 467 | ||
468 | if (!count) | 468 | if (!count) |
469 | return count; | 469 | return count; |
@@ -483,13 +483,13 @@ static int pl2303_write_room(struct usb_serial_port *port) | |||
483 | int room = 0; | 483 | int room = 0; |
484 | unsigned long flags; | 484 | unsigned long flags; |
485 | 485 | ||
486 | dbg("%s - port %d", __FUNCTION__, port->number); | 486 | dbg("%s - port %d", __func__, port->number); |
487 | 487 | ||
488 | spin_lock_irqsave(&priv->lock, flags); | 488 | spin_lock_irqsave(&priv->lock, flags); |
489 | room = pl2303_buf_space_avail(priv->buf); | 489 | room = pl2303_buf_space_avail(priv->buf); |
490 | spin_unlock_irqrestore(&priv->lock, flags); | 490 | spin_unlock_irqrestore(&priv->lock, flags); |
491 | 491 | ||
492 | dbg("%s - returns %d", __FUNCTION__, room); | 492 | dbg("%s - returns %d", __func__, room); |
493 | return room; | 493 | return room; |
494 | } | 494 | } |
495 | 495 | ||
@@ -499,13 +499,13 @@ static int pl2303_chars_in_buffer(struct usb_serial_port *port) | |||
499 | int chars = 0; | 499 | int chars = 0; |
500 | unsigned long flags; | 500 | unsigned long flags; |
501 | 501 | ||
502 | dbg("%s - port %d", __FUNCTION__, port->number); | 502 | dbg("%s - port %d", __func__, port->number); |
503 | 503 | ||
504 | spin_lock_irqsave(&priv->lock, flags); | 504 | spin_lock_irqsave(&priv->lock, flags); |
505 | chars = pl2303_buf_data_avail(priv->buf); | 505 | chars = pl2303_buf_data_avail(priv->buf); |
506 | spin_unlock_irqrestore(&priv->lock, flags); | 506 | spin_unlock_irqrestore(&priv->lock, flags); |
507 | 507 | ||
508 | dbg("%s - returns %d", __FUNCTION__, chars); | 508 | dbg("%s - returns %d", __func__, chars); |
509 | return chars; | 509 | return chars; |
510 | } | 510 | } |
511 | 511 | ||
@@ -521,7 +521,7 @@ static void pl2303_set_termios(struct usb_serial_port *port, | |||
521 | int i; | 521 | int i; |
522 | u8 control; | 522 | u8 control; |
523 | 523 | ||
524 | dbg("%s - port %d", __FUNCTION__, port->number); | 524 | dbg("%s - port %d", __func__, port->number); |
525 | 525 | ||
526 | spin_lock_irqsave(&priv->lock, flags); | 526 | spin_lock_irqsave(&priv->lock, flags); |
527 | if (!priv->termios_initialized) { | 527 | if (!priv->termios_initialized) { |
@@ -545,7 +545,9 @@ static void pl2303_set_termios(struct usb_serial_port *port, | |||
545 | 545 | ||
546 | buf = kzalloc(7, GFP_KERNEL); | 546 | buf = kzalloc(7, GFP_KERNEL); |
547 | if (!buf) { | 547 | if (!buf) { |
548 | dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__); | 548 | dev_err(&port->dev, "%s - out of memory.\n", __func__); |
549 | /* Report back no change occurred */ | ||
550 | *port->tty->termios = *old_termios; | ||
549 | return; | 551 | return; |
550 | } | 552 | } |
551 | 553 | ||
@@ -563,11 +565,11 @@ static void pl2303_set_termios(struct usb_serial_port *port, | |||
563 | default: | 565 | default: |
564 | case CS8: buf[6] = 8; break; | 566 | case CS8: buf[6] = 8; break; |
565 | } | 567 | } |
566 | dbg("%s - data bits = %d", __FUNCTION__, buf[6]); | 568 | dbg("%s - data bits = %d", __func__, buf[6]); |
567 | } | 569 | } |
568 | 570 | ||
569 | baud = tty_get_baud_rate(port->tty);; | 571 | baud = tty_get_baud_rate(port->tty);; |
570 | dbg("%s - baud = %d", __FUNCTION__, baud); | 572 | dbg("%s - baud = %d", __func__, baud); |
571 | if (baud) { | 573 | if (baud) { |
572 | buf[0] = baud & 0xff; | 574 | buf[0] = baud & 0xff; |
573 | buf[1] = (baud >> 8) & 0xff; | 575 | buf[1] = (baud >> 8) & 0xff; |
@@ -580,10 +582,10 @@ static void pl2303_set_termios(struct usb_serial_port *port, | |||
580 | /* For reference buf[4]=2 is 2 stop bits */ | 582 | /* For reference buf[4]=2 is 2 stop bits */ |
581 | if (cflag & CSTOPB) { | 583 | if (cflag & CSTOPB) { |
582 | buf[4] = 2; | 584 | buf[4] = 2; |
583 | dbg("%s - stop bits = 2", __FUNCTION__); | 585 | dbg("%s - stop bits = 2", __func__); |
584 | } else { | 586 | } else { |
585 | buf[4] = 0; | 587 | buf[4] = 0; |
586 | dbg("%s - stop bits = 1", __FUNCTION__); | 588 | dbg("%s - stop bits = 1", __func__); |
587 | } | 589 | } |
588 | 590 | ||
589 | if (cflag & PARENB) { | 591 | if (cflag & PARENB) { |
@@ -594,14 +596,14 @@ static void pl2303_set_termios(struct usb_serial_port *port, | |||
594 | /* For reference buf[5]=4 is space parity */ | 596 | /* For reference buf[5]=4 is space parity */ |
595 | if (cflag & PARODD) { | 597 | if (cflag & PARODD) { |
596 | buf[5] = 1; | 598 | buf[5] = 1; |
597 | dbg("%s - parity = odd", __FUNCTION__); | 599 | dbg("%s - parity = odd", __func__); |
598 | } else { | 600 | } else { |
599 | buf[5] = 2; | 601 | buf[5] = 2; |
600 | dbg("%s - parity = even", __FUNCTION__); | 602 | dbg("%s - parity = even", __func__); |
601 | } | 603 | } |
602 | } else { | 604 | } else { |
603 | buf[5] = 0; | 605 | buf[5] = 0; |
604 | dbg("%s - parity = none", __FUNCTION__); | 606 | dbg("%s - parity = none", __func__); |
605 | } | 607 | } |
606 | 608 | ||
607 | i = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), | 609 | i = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), |
@@ -657,7 +659,7 @@ static void pl2303_close(struct usb_serial_port *port, struct file *filp) | |||
657 | long timeout; | 659 | long timeout; |
658 | wait_queue_t wait; | 660 | wait_queue_t wait; |
659 | 661 | ||
660 | dbg("%s - port %d", __FUNCTION__, port->number); | 662 | dbg("%s - port %d", __func__, port->number); |
661 | 663 | ||
662 | /* wait for data to drain from the buffer */ | 664 | /* wait for data to drain from the buffer */ |
663 | spin_lock_irqsave(&priv->lock, flags); | 665 | spin_lock_irqsave(&priv->lock, flags); |
@@ -695,7 +697,7 @@ static void pl2303_close(struct usb_serial_port *port, struct file *filp) | |||
695 | schedule_timeout_interruptible(timeout); | 697 | schedule_timeout_interruptible(timeout); |
696 | 698 | ||
697 | /* shutdown our urbs */ | 699 | /* shutdown our urbs */ |
698 | dbg("%s - shutting down urbs", __FUNCTION__); | 700 | dbg("%s - shutting down urbs", __func__); |
699 | usb_kill_urb(port->write_urb); | 701 | usb_kill_urb(port->write_urb); |
700 | usb_kill_urb(port->read_urb); | 702 | usb_kill_urb(port->read_urb); |
701 | usb_kill_urb(port->interrupt_in_urb); | 703 | usb_kill_urb(port->interrupt_in_urb); |
@@ -719,7 +721,7 @@ static int pl2303_open(struct usb_serial_port *port, struct file *filp) | |||
719 | struct pl2303_private *priv = usb_get_serial_port_data(port); | 721 | struct pl2303_private *priv = usb_get_serial_port_data(port); |
720 | int result; | 722 | int result; |
721 | 723 | ||
722 | dbg("%s - port %d", __FUNCTION__, port->number); | 724 | dbg("%s - port %d", __func__, port->number); |
723 | 725 | ||
724 | if (priv->type != HX) { | 726 | if (priv->type != HX) { |
725 | usb_clear_halt(serial->dev, port->write_urb->pipe); | 727 | usb_clear_halt(serial->dev, port->write_urb->pipe); |
@@ -737,22 +739,22 @@ static int pl2303_open(struct usb_serial_port *port, struct file *filp) | |||
737 | 739 | ||
738 | //FIXME: need to assert RTS and DTR if CRTSCTS off | 740 | //FIXME: need to assert RTS and DTR if CRTSCTS off |
739 | 741 | ||
740 | dbg("%s - submitting read urb", __FUNCTION__); | 742 | dbg("%s - submitting read urb", __func__); |
741 | port->read_urb->dev = serial->dev; | 743 | port->read_urb->dev = serial->dev; |
742 | result = usb_submit_urb(port->read_urb, GFP_KERNEL); | 744 | result = usb_submit_urb(port->read_urb, GFP_KERNEL); |
743 | if (result) { | 745 | if (result) { |
744 | dev_err(&port->dev, "%s - failed submitting read urb," | 746 | dev_err(&port->dev, "%s - failed submitting read urb," |
745 | " error %d\n", __FUNCTION__, result); | 747 | " error %d\n", __func__, result); |
746 | pl2303_close(port, NULL); | 748 | pl2303_close(port, NULL); |
747 | return -EPROTO; | 749 | return -EPROTO; |
748 | } | 750 | } |
749 | 751 | ||
750 | dbg("%s - submitting interrupt urb", __FUNCTION__); | 752 | dbg("%s - submitting interrupt urb", __func__); |
751 | port->interrupt_in_urb->dev = serial->dev; | 753 | port->interrupt_in_urb->dev = serial->dev; |
752 | result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); | 754 | result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); |
753 | if (result) { | 755 | if (result) { |
754 | dev_err(&port->dev, "%s - failed submitting interrupt urb," | 756 | dev_err(&port->dev, "%s - failed submitting interrupt urb," |
755 | " error %d\n", __FUNCTION__, result); | 757 | " error %d\n", __func__, result); |
756 | pl2303_close(port, NULL); | 758 | pl2303_close(port, NULL); |
757 | return -EPROTO; | 759 | return -EPROTO; |
758 | } | 760 | } |
@@ -792,7 +794,7 @@ static int pl2303_tiocmget(struct usb_serial_port *port, struct file *file) | |||
792 | unsigned int status; | 794 | unsigned int status; |
793 | unsigned int result; | 795 | unsigned int result; |
794 | 796 | ||
795 | dbg("%s (%d)", __FUNCTION__, port->number); | 797 | dbg("%s (%d)", __func__, port->number); |
796 | 798 | ||
797 | if (!usb_get_intfdata(port->serial->interface)) | 799 | if (!usb_get_intfdata(port->serial->interface)) |
798 | return -ENODEV; | 800 | return -ENODEV; |
@@ -809,7 +811,7 @@ static int pl2303_tiocmget(struct usb_serial_port *port, struct file *file) | |||
809 | | ((status & UART_RING) ? TIOCM_RI : 0) | 811 | | ((status & UART_RING) ? TIOCM_RI : 0) |
810 | | ((status & UART_DCD) ? TIOCM_CD : 0); | 812 | | ((status & UART_DCD) ? TIOCM_CD : 0); |
811 | 813 | ||
812 | dbg("%s - result = %x", __FUNCTION__, result); | 814 | dbg("%s - result = %x", __func__, result); |
813 | 815 | ||
814 | return result; | 816 | return result; |
815 | } | 817 | } |
@@ -853,15 +855,15 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg) | |||
853 | static int pl2303_ioctl(struct usb_serial_port *port, struct file *file, | 855 | static int pl2303_ioctl(struct usb_serial_port *port, struct file *file, |
854 | unsigned int cmd, unsigned long arg) | 856 | unsigned int cmd, unsigned long arg) |
855 | { | 857 | { |
856 | dbg("%s (%d) cmd = 0x%04x", __FUNCTION__, port->number, cmd); | 858 | dbg("%s (%d) cmd = 0x%04x", __func__, port->number, cmd); |
857 | 859 | ||
858 | switch (cmd) { | 860 | switch (cmd) { |
859 | case TIOCMIWAIT: | 861 | case TIOCMIWAIT: |
860 | dbg("%s (%d) TIOCMIWAIT", __FUNCTION__, port->number); | 862 | dbg("%s (%d) TIOCMIWAIT", __func__, port->number); |
861 | return wait_modem_info(port, arg); | 863 | return wait_modem_info(port, arg); |
862 | 864 | ||
863 | default: | 865 | default: |
864 | dbg("%s not supported = 0x%04x", __FUNCTION__, cmd); | 866 | dbg("%s not supported = 0x%04x", __func__, cmd); |
865 | break; | 867 | break; |
866 | } | 868 | } |
867 | 869 | ||
@@ -874,19 +876,19 @@ static void pl2303_break_ctl(struct usb_serial_port *port, int break_state) | |||
874 | u16 state; | 876 | u16 state; |
875 | int result; | 877 | int result; |
876 | 878 | ||
877 | dbg("%s - port %d", __FUNCTION__, port->number); | 879 | dbg("%s - port %d", __func__, port->number); |
878 | 880 | ||
879 | if (break_state == 0) | 881 | if (break_state == 0) |
880 | state = BREAK_OFF; | 882 | state = BREAK_OFF; |
881 | else | 883 | else |
882 | state = BREAK_ON; | 884 | state = BREAK_ON; |
883 | dbg("%s - turning break %s", __FUNCTION__, state==BREAK_OFF ? "off" : "on"); | 885 | dbg("%s - turning break %s", __func__, state==BREAK_OFF ? "off" : "on"); |
884 | 886 | ||
885 | result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), | 887 | result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), |
886 | BREAK_REQUEST, BREAK_REQUEST_TYPE, state, | 888 | BREAK_REQUEST, BREAK_REQUEST_TYPE, state, |
887 | 0, NULL, 0, 100); | 889 | 0, NULL, 0, 100); |
888 | if (result) | 890 | if (result) |
889 | dbg("%s - error sending break = %d", __FUNCTION__, result); | 891 | dbg("%s - error sending break = %d", __func__, result); |
890 | } | 892 | } |
891 | 893 | ||
892 | static void pl2303_shutdown(struct usb_serial *serial) | 894 | static void pl2303_shutdown(struct usb_serial *serial) |
@@ -894,7 +896,7 @@ static void pl2303_shutdown(struct usb_serial *serial) | |||
894 | int i; | 896 | int i; |
895 | struct pl2303_private *priv; | 897 | struct pl2303_private *priv; |
896 | 898 | ||
897 | dbg("%s", __FUNCTION__); | 899 | dbg("%s", __func__); |
898 | 900 | ||
899 | for (i = 0; i < serial->num_ports; ++i) { | 901 | for (i = 0; i < serial->num_ports; ++i) { |
900 | priv = usb_get_serial_port_data(serial->port[i]); | 902 | priv = usb_get_serial_port_data(serial->port[i]); |
@@ -943,13 +945,13 @@ static void pl2303_update_line_status(struct usb_serial_port *port, | |||
943 | 945 | ||
944 | static void pl2303_read_int_callback(struct urb *urb) | 946 | static void pl2303_read_int_callback(struct urb *urb) |
945 | { | 947 | { |
946 | struct usb_serial_port *port = (struct usb_serial_port *) urb->context; | 948 | struct usb_serial_port *port = urb->context; |
947 | unsigned char *data = urb->transfer_buffer; | 949 | unsigned char *data = urb->transfer_buffer; |
948 | unsigned int actual_length = urb->actual_length; | 950 | unsigned int actual_length = urb->actual_length; |
949 | int status = urb->status; | 951 | int status = urb->status; |
950 | int retval; | 952 | int retval; |
951 | 953 | ||
952 | dbg("%s (%d)", __FUNCTION__, port->number); | 954 | dbg("%s (%d)", __func__, port->number); |
953 | 955 | ||
954 | switch (status) { | 956 | switch (status) { |
955 | case 0: | 957 | case 0: |
@@ -959,16 +961,16 @@ static void pl2303_read_int_callback(struct urb *urb) | |||
959 | case -ENOENT: | 961 | case -ENOENT: |
960 | case -ESHUTDOWN: | 962 | case -ESHUTDOWN: |
961 | /* this urb is terminated, clean up */ | 963 | /* this urb is terminated, clean up */ |
962 | dbg("%s - urb shutting down with status: %d", __FUNCTION__, | 964 | dbg("%s - urb shutting down with status: %d", __func__, |
963 | status); | 965 | status); |
964 | return; | 966 | return; |
965 | default: | 967 | default: |
966 | dbg("%s - nonzero urb status received: %d", __FUNCTION__, | 968 | dbg("%s - nonzero urb status received: %d", __func__, |
967 | status); | 969 | status); |
968 | goto exit; | 970 | goto exit; |
969 | } | 971 | } |
970 | 972 | ||
971 | usb_serial_debug_data(debug, &port->dev, __FUNCTION__, | 973 | usb_serial_debug_data(debug, &port->dev, __func__, |
972 | urb->actual_length, urb->transfer_buffer); | 974 | urb->actual_length, urb->transfer_buffer); |
973 | 975 | ||
974 | pl2303_update_line_status(port, data, actual_length); | 976 | pl2303_update_line_status(port, data, actual_length); |
@@ -978,12 +980,12 @@ exit: | |||
978 | if (retval) | 980 | if (retval) |
979 | dev_err(&urb->dev->dev, | 981 | dev_err(&urb->dev->dev, |
980 | "%s - usb_submit_urb failed with result %d\n", | 982 | "%s - usb_submit_urb failed with result %d\n", |
981 | __FUNCTION__, retval); | 983 | __func__, retval); |
982 | } | 984 | } |
983 | 985 | ||
984 | static void pl2303_read_bulk_callback(struct urb *urb) | 986 | static void pl2303_read_bulk_callback(struct urb *urb) |
985 | { | 987 | { |
986 | struct usb_serial_port *port = (struct usb_serial_port *) urb->context; | 988 | struct usb_serial_port *port = urb->context; |
987 | struct pl2303_private *priv = usb_get_serial_port_data(port); | 989 | struct pl2303_private *priv = usb_get_serial_port_data(port); |
988 | struct tty_struct *tty; | 990 | struct tty_struct *tty; |
989 | unsigned char *data = urb->transfer_buffer; | 991 | unsigned char *data = urb->transfer_buffer; |
@@ -994,32 +996,32 @@ static void pl2303_read_bulk_callback(struct urb *urb) | |||
994 | u8 line_status; | 996 | u8 line_status; |
995 | char tty_flag; | 997 | char tty_flag; |
996 | 998 | ||
997 | dbg("%s - port %d", __FUNCTION__, port->number); | 999 | dbg("%s - port %d", __func__, port->number); |
998 | 1000 | ||
999 | if (status) { | 1001 | if (status) { |
1000 | dbg("%s - urb status = %d", __FUNCTION__, status); | 1002 | dbg("%s - urb status = %d", __func__, status); |
1001 | if (!port->open_count) { | 1003 | if (!port->open_count) { |
1002 | dbg("%s - port is closed, exiting.", __FUNCTION__); | 1004 | dbg("%s - port is closed, exiting.", __func__); |
1003 | return; | 1005 | return; |
1004 | } | 1006 | } |
1005 | if (status == -EPROTO) { | 1007 | if (status == -EPROTO) { |
1006 | /* PL2303 mysteriously fails with -EPROTO reschedule | 1008 | /* PL2303 mysteriously fails with -EPROTO reschedule |
1007 | * the read */ | 1009 | * the read */ |
1008 | dbg("%s - caught -EPROTO, resubmitting the urb", | 1010 | dbg("%s - caught -EPROTO, resubmitting the urb", |
1009 | __FUNCTION__); | 1011 | __func__); |
1010 | urb->dev = port->serial->dev; | 1012 | urb->dev = port->serial->dev; |
1011 | result = usb_submit_urb(urb, GFP_ATOMIC); | 1013 | result = usb_submit_urb(urb, GFP_ATOMIC); |
1012 | if (result) | 1014 | if (result) |
1013 | dev_err(&urb->dev->dev, "%s - failed" | 1015 | dev_err(&urb->dev->dev, "%s - failed" |
1014 | " resubmitting read urb, error %d\n", | 1016 | " resubmitting read urb, error %d\n", |
1015 | __FUNCTION__, result); | 1017 | __func__, result); |
1016 | return; | 1018 | return; |
1017 | } | 1019 | } |
1018 | dbg("%s - unable to handle the error, exiting.", __FUNCTION__); | 1020 | dbg("%s - unable to handle the error, exiting.", __func__); |
1019 | return; | 1021 | return; |
1020 | } | 1022 | } |
1021 | 1023 | ||
1022 | usb_serial_debug_data(debug, &port->dev, __FUNCTION__, | 1024 | usb_serial_debug_data(debug, &port->dev, __func__, |
1023 | urb->actual_length, data); | 1025 | urb->actual_length, data); |
1024 | 1026 | ||
1025 | /* get tty_flag from status */ | 1027 | /* get tty_flag from status */ |
@@ -1039,7 +1041,7 @@ static void pl2303_read_bulk_callback(struct urb *urb) | |||
1039 | tty_flag = TTY_PARITY; | 1041 | tty_flag = TTY_PARITY; |
1040 | else if (line_status & UART_FRAME_ERROR) | 1042 | else if (line_status & UART_FRAME_ERROR) |
1041 | tty_flag = TTY_FRAME; | 1043 | tty_flag = TTY_FRAME; |
1042 | dbg("%s - tty_flag = %d", __FUNCTION__, tty_flag); | 1044 | dbg("%s - tty_flag = %d", __func__, tty_flag); |
1043 | 1045 | ||
1044 | tty = port->tty; | 1046 | tty = port->tty; |
1045 | if (tty && urb->actual_length) { | 1047 | if (tty && urb->actual_length) { |
@@ -1058,7 +1060,7 @@ static void pl2303_read_bulk_callback(struct urb *urb) | |||
1058 | result = usb_submit_urb(urb, GFP_ATOMIC); | 1060 | result = usb_submit_urb(urb, GFP_ATOMIC); |
1059 | if (result) | 1061 | if (result) |
1060 | dev_err(&urb->dev->dev, "%s - failed resubmitting" | 1062 | dev_err(&urb->dev->dev, "%s - failed resubmitting" |
1061 | " read urb, error %d\n", __FUNCTION__, result); | 1063 | " read urb, error %d\n", __func__, result); |
1062 | } | 1064 | } |
1063 | 1065 | ||
1064 | return; | 1066 | return; |
@@ -1066,12 +1068,12 @@ static void pl2303_read_bulk_callback(struct urb *urb) | |||
1066 | 1068 | ||
1067 | static void pl2303_write_bulk_callback(struct urb *urb) | 1069 | static void pl2303_write_bulk_callback(struct urb *urb) |
1068 | { | 1070 | { |
1069 | struct usb_serial_port *port = (struct usb_serial_port *) urb->context; | 1071 | struct usb_serial_port *port = urb->context; |
1070 | struct pl2303_private *priv = usb_get_serial_port_data(port); | 1072 | struct pl2303_private *priv = usb_get_serial_port_data(port); |
1071 | int result; | 1073 | int result; |
1072 | int status = urb->status; | 1074 | int status = urb->status; |
1073 | 1075 | ||
1074 | dbg("%s - port %d", __FUNCTION__, port->number); | 1076 | dbg("%s - port %d", __func__, port->number); |
1075 | 1077 | ||
1076 | switch (status) { | 1078 | switch (status) { |
1077 | case 0: | 1079 | case 0: |
@@ -1081,21 +1083,21 @@ static void pl2303_write_bulk_callback(struct urb *urb) | |||
1081 | case -ENOENT: | 1083 | case -ENOENT: |
1082 | case -ESHUTDOWN: | 1084 | case -ESHUTDOWN: |
1083 | /* this urb is terminated, clean up */ | 1085 | /* this urb is terminated, clean up */ |
1084 | dbg("%s - urb shutting down with status: %d", __FUNCTION__, | 1086 | dbg("%s - urb shutting down with status: %d", __func__, |
1085 | status); | 1087 | status); |
1086 | priv->write_urb_in_use = 0; | 1088 | priv->write_urb_in_use = 0; |
1087 | return; | 1089 | return; |
1088 | default: | 1090 | default: |
1089 | /* error in the urb, so we have to resubmit it */ | 1091 | /* error in the urb, so we have to resubmit it */ |
1090 | dbg("%s - Overflow in write", __FUNCTION__); | 1092 | dbg("%s - Overflow in write", __func__); |
1091 | dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, | 1093 | dbg("%s - nonzero write bulk status received: %d", __func__, |
1092 | status); | 1094 | status); |
1093 | port->write_urb->transfer_buffer_length = 1; | 1095 | port->write_urb->transfer_buffer_length = 1; |
1094 | port->write_urb->dev = port->serial->dev; | 1096 | port->write_urb->dev = port->serial->dev; |
1095 | result = usb_submit_urb(port->write_urb, GFP_ATOMIC); | 1097 | result = usb_submit_urb(port->write_urb, GFP_ATOMIC); |
1096 | if (result) | 1098 | if (result) |
1097 | dev_err(&urb->dev->dev, "%s - failed resubmitting write" | 1099 | dev_err(&urb->dev->dev, "%s - failed resubmitting write" |
1098 | " urb, error %d\n", __FUNCTION__, result); | 1100 | " urb, error %d\n", __func__, result); |
1099 | else | 1101 | else |
1100 | return; | 1102 | return; |
1101 | } | 1103 | } |
@@ -1114,9 +1116,6 @@ static struct usb_serial_driver pl2303_device = { | |||
1114 | }, | 1116 | }, |
1115 | .id_table = id_table, | 1117 | .id_table = id_table, |
1116 | .usb_driver = &pl2303_driver, | 1118 | .usb_driver = &pl2303_driver, |
1117 | .num_interrupt_in = NUM_DONT_CARE, | ||
1118 | .num_bulk_in = 1, | ||
1119 | .num_bulk_out = 1, | ||
1120 | .num_ports = 1, | 1119 | .num_ports = 1, |
1121 | .open = pl2303_open, | 1120 | .open = pl2303_open, |
1122 | .close = pl2303_close, | 1121 | .close = pl2303_close, |