diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/serial/io_ti.c | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index fbc2e024c335..1c6850a074d4 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -1719,13 +1719,14 @@ static void edge_interrupt_callback (struct urb *urb) | |||
1719 | int length = urb->actual_length; | 1719 | int length = urb->actual_length; |
1720 | int port_number; | 1720 | int port_number; |
1721 | int function; | 1721 | int function; |
1722 | int status; | 1722 | int retval; |
1723 | __u8 lsr; | 1723 | __u8 lsr; |
1724 | __u8 msr; | 1724 | __u8 msr; |
1725 | int status = urb->status; | ||
1725 | 1726 | ||
1726 | dbg("%s", __FUNCTION__); | 1727 | dbg("%s", __FUNCTION__); |
1727 | 1728 | ||
1728 | switch (urb->status) { | 1729 | switch (status) { |
1729 | case 0: | 1730 | case 0: |
1730 | /* success */ | 1731 | /* success */ |
1731 | break; | 1732 | break; |
@@ -1733,10 +1734,12 @@ static void edge_interrupt_callback (struct urb *urb) | |||
1733 | case -ENOENT: | 1734 | case -ENOENT: |
1734 | case -ESHUTDOWN: | 1735 | case -ESHUTDOWN: |
1735 | /* this urb is terminated, clean up */ | 1736 | /* this urb is terminated, clean up */ |
1736 | dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status); | 1737 | dbg("%s - urb shutting down with status: %d", |
1738 | __FUNCTION__, status); | ||
1737 | return; | 1739 | return; |
1738 | default: | 1740 | default: |
1739 | dev_err(&urb->dev->dev, "%s - nonzero urb status received: %d\n", __FUNCTION__, urb->status); | 1741 | dev_err(&urb->dev->dev, "%s - nonzero urb status received: " |
1742 | "%d\n", __FUNCTION__, status); | ||
1740 | goto exit; | 1743 | goto exit; |
1741 | } | 1744 | } |
1742 | 1745 | ||
@@ -1794,10 +1797,10 @@ static void edge_interrupt_callback (struct urb *urb) | |||
1794 | } | 1797 | } |
1795 | 1798 | ||
1796 | exit: | 1799 | exit: |
1797 | status = usb_submit_urb (urb, GFP_ATOMIC); | 1800 | retval = usb_submit_urb (urb, GFP_ATOMIC); |
1798 | if (status) | 1801 | if (retval) |
1799 | dev_err (&urb->dev->dev, "%s - usb_submit_urb failed with result %d\n", | 1802 | dev_err (&urb->dev->dev, "%s - usb_submit_urb failed with result %d\n", |
1800 | __FUNCTION__, status); | 1803 | __FUNCTION__, retval); |
1801 | } | 1804 | } |
1802 | 1805 | ||
1803 | static void edge_bulk_in_callback (struct urb *urb) | 1806 | static void edge_bulk_in_callback (struct urb *urb) |
@@ -1805,12 +1808,13 @@ static void edge_bulk_in_callback (struct urb *urb) | |||
1805 | struct edgeport_port *edge_port = (struct edgeport_port *)urb->context; | 1808 | struct edgeport_port *edge_port = (struct edgeport_port *)urb->context; |
1806 | unsigned char *data = urb->transfer_buffer; | 1809 | unsigned char *data = urb->transfer_buffer; |
1807 | struct tty_struct *tty; | 1810 | struct tty_struct *tty; |
1808 | int status = 0; | 1811 | int retval = 0; |
1809 | int port_number; | 1812 | int port_number; |
1813 | int status = urb->status; | ||
1810 | 1814 | ||
1811 | dbg("%s", __FUNCTION__); | 1815 | dbg("%s", __FUNCTION__); |
1812 | 1816 | ||
1813 | switch (urb->status) { | 1817 | switch (status) { |
1814 | case 0: | 1818 | case 0: |
1815 | /* success */ | 1819 | /* success */ |
1816 | break; | 1820 | break; |
@@ -1818,17 +1822,18 @@ static void edge_bulk_in_callback (struct urb *urb) | |||
1818 | case -ENOENT: | 1822 | case -ENOENT: |
1819 | case -ESHUTDOWN: | 1823 | case -ESHUTDOWN: |
1820 | /* this urb is terminated, clean up */ | 1824 | /* this urb is terminated, clean up */ |
1821 | dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status); | 1825 | dbg("%s - urb shutting down with status: %d", |
1826 | __FUNCTION__, status); | ||
1822 | return; | 1827 | return; |
1823 | default: | 1828 | default: |
1824 | dev_err (&urb->dev->dev,"%s - nonzero read bulk status received: %d\n", | 1829 | dev_err (&urb->dev->dev,"%s - nonzero read bulk status received: %d\n", |
1825 | __FUNCTION__, urb->status ); | 1830 | __FUNCTION__, status); |
1826 | } | 1831 | } |
1827 | 1832 | ||
1828 | if (urb->status == -EPIPE) | 1833 | if (status == -EPIPE) |
1829 | goto exit; | 1834 | goto exit; |
1830 | 1835 | ||
1831 | if (urb->status) { | 1836 | if (status) { |
1832 | dev_err(&urb->dev->dev,"%s - stopping read!\n", __FUNCTION__); | 1837 | dev_err(&urb->dev->dev,"%s - stopping read!\n", __FUNCTION__); |
1833 | return; | 1838 | return; |
1834 | } | 1839 | } |
@@ -1862,14 +1867,14 @@ exit: | |||
1862 | spin_lock(&edge_port->ep_lock); | 1867 | spin_lock(&edge_port->ep_lock); |
1863 | if (edge_port->ep_read_urb_state == EDGE_READ_URB_RUNNING) { | 1868 | if (edge_port->ep_read_urb_state == EDGE_READ_URB_RUNNING) { |
1864 | urb->dev = edge_port->port->serial->dev; | 1869 | urb->dev = edge_port->port->serial->dev; |
1865 | status = usb_submit_urb(urb, GFP_ATOMIC); | 1870 | retval = usb_submit_urb(urb, GFP_ATOMIC); |
1866 | } else if (edge_port->ep_read_urb_state == EDGE_READ_URB_STOPPING) { | 1871 | } else if (edge_port->ep_read_urb_state == EDGE_READ_URB_STOPPING) { |
1867 | edge_port->ep_read_urb_state = EDGE_READ_URB_STOPPED; | 1872 | edge_port->ep_read_urb_state = EDGE_READ_URB_STOPPED; |
1868 | } | 1873 | } |
1869 | spin_unlock(&edge_port->ep_lock); | 1874 | spin_unlock(&edge_port->ep_lock); |
1870 | if (status) | 1875 | if (retval) |
1871 | dev_err (&urb->dev->dev, "%s - usb_submit_urb failed with result %d\n", | 1876 | dev_err (&urb->dev->dev, "%s - usb_submit_urb failed with result %d\n", |
1872 | __FUNCTION__, status); | 1877 | __FUNCTION__, retval); |
1873 | } | 1878 | } |
1874 | 1879 | ||
1875 | static void edge_tty_recv(struct device *dev, struct tty_struct *tty, unsigned char *data, int length) | 1880 | static void edge_tty_recv(struct device *dev, struct tty_struct *tty, unsigned char *data, int length) |
@@ -1896,12 +1901,13 @@ static void edge_bulk_out_callback (struct urb *urb) | |||
1896 | { | 1901 | { |
1897 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; | 1902 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; |
1898 | struct edgeport_port *edge_port = usb_get_serial_port_data(port); | 1903 | struct edgeport_port *edge_port = usb_get_serial_port_data(port); |
1904 | int status = urb->status; | ||
1899 | 1905 | ||
1900 | dbg ("%s - port %d", __FUNCTION__, port->number); | 1906 | dbg ("%s - port %d", __FUNCTION__, port->number); |
1901 | 1907 | ||
1902 | edge_port->ep_write_urb_in_use = 0; | 1908 | edge_port->ep_write_urb_in_use = 0; |
1903 | 1909 | ||
1904 | switch (urb->status) { | 1910 | switch (status) { |
1905 | case 0: | 1911 | case 0: |
1906 | /* success */ | 1912 | /* success */ |
1907 | break; | 1913 | break; |
@@ -1909,11 +1915,12 @@ static void edge_bulk_out_callback (struct urb *urb) | |||
1909 | case -ENOENT: | 1915 | case -ENOENT: |
1910 | case -ESHUTDOWN: | 1916 | case -ESHUTDOWN: |
1911 | /* this urb is terminated, clean up */ | 1917 | /* this urb is terminated, clean up */ |
1912 | dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status); | 1918 | dbg("%s - urb shutting down with status: %d", |
1919 | __FUNCTION__, status); | ||
1913 | return; | 1920 | return; |
1914 | default: | 1921 | default: |
1915 | dev_err (&urb->dev->dev,"%s - nonzero write bulk status received: %d\n", | 1922 | dev_err(&urb->dev->dev, "%s - nonzero write bulk status " |
1916 | __FUNCTION__, urb->status); | 1923 | "received: %d\n", __FUNCTION__, status); |
1917 | } | 1924 | } |
1918 | 1925 | ||
1919 | /* send any buffered data */ | 1926 | /* send any buffered data */ |