diff options
Diffstat (limited to 'drivers/usb/serial/ipaq.c')
-rw-r--r-- | drivers/usb/serial/ipaq.c | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index 9b38a08ac83a..ea924dc48496 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c | |||
@@ -570,10 +570,7 @@ static struct usb_serial_driver ipaq_device = { | |||
570 | .description = "PocketPC PDA", | 570 | .description = "PocketPC PDA", |
571 | .usb_driver = &ipaq_driver, | 571 | .usb_driver = &ipaq_driver, |
572 | .id_table = ipaq_id_table, | 572 | .id_table = ipaq_id_table, |
573 | .num_interrupt_in = NUM_DONT_CARE, | 573 | .num_ports = 2, |
574 | .num_bulk_in = 1, | ||
575 | .num_bulk_out = 1, | ||
576 | .num_ports = 1, | ||
577 | .open = ipaq_open, | 574 | .open = ipaq_open, |
578 | .close = ipaq_close, | 575 | .close = ipaq_close, |
579 | .attach = ipaq_startup, | 576 | .attach = ipaq_startup, |
@@ -597,13 +594,13 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) | |||
597 | int i, result = 0; | 594 | int i, result = 0; |
598 | int retries = connect_retries; | 595 | int retries = connect_retries; |
599 | 596 | ||
600 | dbg("%s - port %d", __FUNCTION__, port->number); | 597 | dbg("%s - port %d", __func__, port->number); |
601 | 598 | ||
602 | bytes_in = 0; | 599 | bytes_in = 0; |
603 | bytes_out = 0; | 600 | bytes_out = 0; |
604 | priv = kmalloc(sizeof(struct ipaq_private), GFP_KERNEL); | 601 | priv = kmalloc(sizeof(struct ipaq_private), GFP_KERNEL); |
605 | if (priv == NULL) { | 602 | if (priv == NULL) { |
606 | err("%s - Out of memory", __FUNCTION__); | 603 | err("%s - Out of memory", __func__); |
607 | return -ENOMEM; | 604 | return -ENOMEM; |
608 | } | 605 | } |
609 | usb_set_serial_port_data(port, priv); | 606 | usb_set_serial_port_data(port, priv); |
@@ -682,7 +679,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) | |||
682 | } | 679 | } |
683 | 680 | ||
684 | if (!retries && result) { | 681 | if (!retries && result) { |
685 | err("%s - failed doing control urb, error %d", __FUNCTION__, | 682 | err("%s - failed doing control urb, error %d", __func__, |
686 | result); | 683 | result); |
687 | goto error; | 684 | goto error; |
688 | } | 685 | } |
@@ -695,7 +692,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) | |||
695 | 692 | ||
696 | result = usb_submit_urb(port->read_urb, GFP_KERNEL); | 693 | result = usb_submit_urb(port->read_urb, GFP_KERNEL); |
697 | if (result) { | 694 | if (result) { |
698 | err("%s - failed submitting read urb, error %d", __FUNCTION__, result); | 695 | err("%s - failed submitting read urb, error %d", __func__, result); |
699 | goto error; | 696 | goto error; |
700 | } | 697 | } |
701 | 698 | ||
@@ -703,7 +700,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) | |||
703 | 700 | ||
704 | enomem: | 701 | enomem: |
705 | result = -ENOMEM; | 702 | result = -ENOMEM; |
706 | err("%s - Out of memory", __FUNCTION__); | 703 | err("%s - Out of memory", __func__); |
707 | error: | 704 | error: |
708 | ipaq_destroy_lists(port); | 705 | ipaq_destroy_lists(port); |
709 | kfree(priv); | 706 | kfree(priv); |
@@ -715,7 +712,7 @@ static void ipaq_close(struct usb_serial_port *port, struct file *filp) | |||
715 | { | 712 | { |
716 | struct ipaq_private *priv = usb_get_serial_port_data(port); | 713 | struct ipaq_private *priv = usb_get_serial_port_data(port); |
717 | 714 | ||
718 | dbg("%s - port %d", __FUNCTION__, port->number); | 715 | dbg("%s - port %d", __func__, port->number); |
719 | 716 | ||
720 | /* | 717 | /* |
721 | * shut down bulk read and write | 718 | * shut down bulk read and write |
@@ -732,21 +729,21 @@ static void ipaq_close(struct usb_serial_port *port, struct file *filp) | |||
732 | 729 | ||
733 | static void ipaq_read_bulk_callback(struct urb *urb) | 730 | static void ipaq_read_bulk_callback(struct urb *urb) |
734 | { | 731 | { |
735 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; | 732 | struct usb_serial_port *port = urb->context; |
736 | struct tty_struct *tty; | 733 | struct tty_struct *tty; |
737 | unsigned char *data = urb->transfer_buffer; | 734 | unsigned char *data = urb->transfer_buffer; |
738 | int result; | 735 | int result; |
739 | int status = urb->status; | 736 | int status = urb->status; |
740 | 737 | ||
741 | dbg("%s - port %d", __FUNCTION__, port->number); | 738 | dbg("%s - port %d", __func__, port->number); |
742 | 739 | ||
743 | if (status) { | 740 | if (status) { |
744 | dbg("%s - nonzero read bulk status received: %d", | 741 | dbg("%s - nonzero read bulk status received: %d", |
745 | __FUNCTION__, status); | 742 | __func__, status); |
746 | return; | 743 | return; |
747 | } | 744 | } |
748 | 745 | ||
749 | usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data); | 746 | usb_serial_debug_data(debug, &port->dev, __func__, urb->actual_length, data); |
750 | 747 | ||
751 | tty = port->tty; | 748 | tty = port->tty; |
752 | if (tty && urb->actual_length) { | 749 | if (tty && urb->actual_length) { |
@@ -763,7 +760,7 @@ static void ipaq_read_bulk_callback(struct urb *urb) | |||
763 | ipaq_read_bulk_callback, port); | 760 | ipaq_read_bulk_callback, port); |
764 | result = usb_submit_urb(port->read_urb, GFP_ATOMIC); | 761 | result = usb_submit_urb(port->read_urb, GFP_ATOMIC); |
765 | if (result) | 762 | if (result) |
766 | err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); | 763 | err("%s - failed resubmitting read urb, error %d", __func__, result); |
767 | return; | 764 | return; |
768 | } | 765 | } |
769 | 766 | ||
@@ -774,7 +771,7 @@ static int ipaq_write(struct usb_serial_port *port, const unsigned char *buf, | |||
774 | int bytes_sent = 0; | 771 | int bytes_sent = 0; |
775 | int transfer_size; | 772 | int transfer_size; |
776 | 773 | ||
777 | dbg("%s - port %d", __FUNCTION__, port->number); | 774 | dbg("%s - port %d", __func__, port->number); |
778 | 775 | ||
779 | while (count > 0) { | 776 | while (count > 0) { |
780 | transfer_size = min(count, PACKET_SIZE); | 777 | transfer_size = min(count, PACKET_SIZE); |
@@ -799,7 +796,7 @@ static int ipaq_write_bulk(struct usb_serial_port *port, const unsigned char *bu | |||
799 | unsigned long flags; | 796 | unsigned long flags; |
800 | 797 | ||
801 | if (priv->free_len <= 0) { | 798 | if (priv->free_len <= 0) { |
802 | dbg("%s - we're stuffed", __FUNCTION__); | 799 | dbg("%s - we're stuffed", __func__); |
803 | return -EAGAIN; | 800 | return -EAGAIN; |
804 | } | 801 | } |
805 | 802 | ||
@@ -811,12 +808,12 @@ static int ipaq_write_bulk(struct usb_serial_port *port, const unsigned char *bu | |||
811 | } | 808 | } |
812 | spin_unlock_irqrestore(&write_list_lock, flags); | 809 | spin_unlock_irqrestore(&write_list_lock, flags); |
813 | if (pkt == NULL) { | 810 | if (pkt == NULL) { |
814 | dbg("%s - we're stuffed", __FUNCTION__); | 811 | dbg("%s - we're stuffed", __func__); |
815 | return -EAGAIN; | 812 | return -EAGAIN; |
816 | } | 813 | } |
817 | 814 | ||
818 | memcpy(pkt->data, buf, count); | 815 | memcpy(pkt->data, buf, count); |
819 | usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, pkt->data); | 816 | usb_serial_debug_data(debug, &port->dev, __func__, count, pkt->data); |
820 | 817 | ||
821 | pkt->len = count; | 818 | pkt->len = count; |
822 | pkt->written = 0; | 819 | pkt->written = 0; |
@@ -829,7 +826,7 @@ static int ipaq_write_bulk(struct usb_serial_port *port, const unsigned char *bu | |||
829 | spin_unlock_irqrestore(&write_list_lock, flags); | 826 | spin_unlock_irqrestore(&write_list_lock, flags); |
830 | result = usb_submit_urb(port->write_urb, GFP_ATOMIC); | 827 | result = usb_submit_urb(port->write_urb, GFP_ATOMIC); |
831 | if (result) { | 828 | if (result) { |
832 | err("%s - failed submitting write urb, error %d", __FUNCTION__, result); | 829 | err("%s - failed submitting write urb, error %d", __func__, result); |
833 | } | 830 | } |
834 | } else { | 831 | } else { |
835 | spin_unlock_irqrestore(&write_list_lock, flags); | 832 | spin_unlock_irqrestore(&write_list_lock, flags); |
@@ -872,17 +869,17 @@ static void ipaq_write_gather(struct usb_serial_port *port) | |||
872 | 869 | ||
873 | static void ipaq_write_bulk_callback(struct urb *urb) | 870 | static void ipaq_write_bulk_callback(struct urb *urb) |
874 | { | 871 | { |
875 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; | 872 | struct usb_serial_port *port = urb->context; |
876 | struct ipaq_private *priv = usb_get_serial_port_data(port); | 873 | struct ipaq_private *priv = usb_get_serial_port_data(port); |
877 | unsigned long flags; | 874 | unsigned long flags; |
878 | int result; | 875 | int result; |
879 | int status = urb->status; | 876 | int status = urb->status; |
880 | 877 | ||
881 | dbg("%s - port %d", __FUNCTION__, port->number); | 878 | dbg("%s - port %d", __func__, port->number); |
882 | 879 | ||
883 | if (status) { | 880 | if (status) { |
884 | dbg("%s - nonzero write bulk status received: %d", | 881 | dbg("%s - nonzero write bulk status received: %d", |
885 | __FUNCTION__, status); | 882 | __func__, status); |
886 | return; | 883 | return; |
887 | } | 884 | } |
888 | 885 | ||
@@ -892,7 +889,7 @@ static void ipaq_write_bulk_callback(struct urb *urb) | |||
892 | spin_unlock_irqrestore(&write_list_lock, flags); | 889 | spin_unlock_irqrestore(&write_list_lock, flags); |
893 | result = usb_submit_urb(port->write_urb, GFP_ATOMIC); | 890 | result = usb_submit_urb(port->write_urb, GFP_ATOMIC); |
894 | if (result) { | 891 | if (result) { |
895 | err("%s - failed submitting write urb, error %d", __FUNCTION__, result); | 892 | err("%s - failed submitting write urb, error %d", __func__, result); |
896 | } | 893 | } |
897 | } else { | 894 | } else { |
898 | priv->active = 0; | 895 | priv->active = 0; |
@@ -906,7 +903,7 @@ static int ipaq_write_room(struct usb_serial_port *port) | |||
906 | { | 903 | { |
907 | struct ipaq_private *priv = usb_get_serial_port_data(port); | 904 | struct ipaq_private *priv = usb_get_serial_port_data(port); |
908 | 905 | ||
909 | dbg("%s - freelen %d", __FUNCTION__, priv->free_len); | 906 | dbg("%s - freelen %d", __func__, priv->free_len); |
910 | return priv->free_len; | 907 | return priv->free_len; |
911 | } | 908 | } |
912 | 909 | ||
@@ -914,7 +911,7 @@ static int ipaq_chars_in_buffer(struct usb_serial_port *port) | |||
914 | { | 911 | { |
915 | struct ipaq_private *priv = usb_get_serial_port_data(port); | 912 | struct ipaq_private *priv = usb_get_serial_port_data(port); |
916 | 913 | ||
917 | dbg("%s - queuelen %d", __FUNCTION__, priv->queue_len); | 914 | dbg("%s - queuelen %d", __func__, priv->queue_len); |
918 | return priv->queue_len; | 915 | return priv->queue_len; |
919 | } | 916 | } |
920 | 917 | ||
@@ -936,7 +933,7 @@ static void ipaq_destroy_lists(struct usb_serial_port *port) | |||
936 | 933 | ||
937 | static int ipaq_startup(struct usb_serial *serial) | 934 | static int ipaq_startup(struct usb_serial *serial) |
938 | { | 935 | { |
939 | dbg("%s", __FUNCTION__); | 936 | dbg("%s", __func__); |
940 | if (serial->dev->actconfig->desc.bConfigurationValue != 1) { | 937 | if (serial->dev->actconfig->desc.bConfigurationValue != 1) { |
941 | err("active config #%d != 1 ??", | 938 | err("active config #%d != 1 ??", |
942 | serial->dev->actconfig->desc.bConfigurationValue); | 939 | serial->dev->actconfig->desc.bConfigurationValue); |
@@ -947,7 +944,7 @@ static int ipaq_startup(struct usb_serial *serial) | |||
947 | 944 | ||
948 | static void ipaq_shutdown(struct usb_serial *serial) | 945 | static void ipaq_shutdown(struct usb_serial *serial) |
949 | { | 946 | { |
950 | dbg("%s", __FUNCTION__); | 947 | dbg("%s", __func__); |
951 | } | 948 | } |
952 | 949 | ||
953 | static int __init ipaq_init(void) | 950 | static int __init ipaq_init(void) |