diff options
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 3dc93b542b30..c2ac129557aa 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -860,7 +860,7 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set, | |||
860 | 860 | ||
861 | kfree(buf); | 861 | kfree(buf); |
862 | if (rv < 0) { | 862 | if (rv < 0) { |
863 | err("%s Error from MODEM_CTRL urb: DTR %s, RTS %s", | 863 | dbg("%s Error from MODEM_CTRL urb: DTR %s, RTS %s", |
864 | __func__, | 864 | __func__, |
865 | (set & TIOCM_DTR) ? "HIGH" : | 865 | (set & TIOCM_DTR) ? "HIGH" : |
866 | (clear & TIOCM_DTR) ? "LOW" : "unchanged", | 866 | (clear & TIOCM_DTR) ? "LOW" : "unchanged", |
@@ -1808,7 +1808,7 @@ static void ftdi_read_bulk_callback(struct urb *urb) | |||
1808 | if (port->port.count <= 0) | 1808 | if (port->port.count <= 0) |
1809 | return; | 1809 | return; |
1810 | 1810 | ||
1811 | tty = port->port.tty; | 1811 | tty = tty_port_tty_get(&port->port); |
1812 | if (!tty) { | 1812 | if (!tty) { |
1813 | dbg("%s - bad tty pointer - exiting", __func__); | 1813 | dbg("%s - bad tty pointer - exiting", __func__); |
1814 | return; | 1814 | return; |
@@ -1817,7 +1817,7 @@ static void ftdi_read_bulk_callback(struct urb *urb) | |||
1817 | priv = usb_get_serial_port_data(port); | 1817 | priv = usb_get_serial_port_data(port); |
1818 | if (!priv) { | 1818 | if (!priv) { |
1819 | dbg("%s - bad port private data pointer - exiting", __func__); | 1819 | dbg("%s - bad port private data pointer - exiting", __func__); |
1820 | return; | 1820 | goto out; |
1821 | } | 1821 | } |
1822 | 1822 | ||
1823 | if (urb != port->read_urb) | 1823 | if (urb != port->read_urb) |
@@ -1827,7 +1827,7 @@ static void ftdi_read_bulk_callback(struct urb *urb) | |||
1827 | /* This will happen at close every time so it is a dbg not an | 1827 | /* This will happen at close every time so it is a dbg not an |
1828 | err */ | 1828 | err */ |
1829 | dbg("(this is ok on close) nonzero read bulk status received: %d", status); | 1829 | dbg("(this is ok on close) nonzero read bulk status received: %d", status); |
1830 | return; | 1830 | goto out; |
1831 | } | 1831 | } |
1832 | 1832 | ||
1833 | /* count data bytes, but not status bytes */ | 1833 | /* count data bytes, but not status bytes */ |
@@ -1838,7 +1838,8 @@ static void ftdi_read_bulk_callback(struct urb *urb) | |||
1838 | spin_unlock_irqrestore(&priv->rx_lock, flags); | 1838 | spin_unlock_irqrestore(&priv->rx_lock, flags); |
1839 | 1839 | ||
1840 | ftdi_process_read(&priv->rx_work.work); | 1840 | ftdi_process_read(&priv->rx_work.work); |
1841 | 1841 | out: | |
1842 | tty_kref_put(tty); | ||
1842 | } /* ftdi_read_bulk_callback */ | 1843 | } /* ftdi_read_bulk_callback */ |
1843 | 1844 | ||
1844 | 1845 | ||
@@ -1863,7 +1864,7 @@ static void ftdi_process_read(struct work_struct *work) | |||
1863 | if (port->port.count <= 0) | 1864 | if (port->port.count <= 0) |
1864 | return; | 1865 | return; |
1865 | 1866 | ||
1866 | tty = port->port.tty; | 1867 | tty = tty_port_tty_get(&port->port); |
1867 | if (!tty) { | 1868 | if (!tty) { |
1868 | dbg("%s - bad tty pointer - exiting", __func__); | 1869 | dbg("%s - bad tty pointer - exiting", __func__); |
1869 | return; | 1870 | return; |
@@ -1872,13 +1873,13 @@ static void ftdi_process_read(struct work_struct *work) | |||
1872 | priv = usb_get_serial_port_data(port); | 1873 | priv = usb_get_serial_port_data(port); |
1873 | if (!priv) { | 1874 | if (!priv) { |
1874 | dbg("%s - bad port private data pointer - exiting", __func__); | 1875 | dbg("%s - bad port private data pointer - exiting", __func__); |
1875 | return; | 1876 | goto out; |
1876 | } | 1877 | } |
1877 | 1878 | ||
1878 | urb = port->read_urb; | 1879 | urb = port->read_urb; |
1879 | if (!urb) { | 1880 | if (!urb) { |
1880 | dbg("%s - bad read_urb pointer - exiting", __func__); | 1881 | dbg("%s - bad read_urb pointer - exiting", __func__); |
1881 | return; | 1882 | goto out; |
1882 | } | 1883 | } |
1883 | 1884 | ||
1884 | data = urb->transfer_buffer; | 1885 | data = urb->transfer_buffer; |
@@ -2020,7 +2021,7 @@ static void ftdi_process_read(struct work_struct *work) | |||
2020 | schedule_delayed_work(&priv->rx_work, 1); | 2021 | schedule_delayed_work(&priv->rx_work, 1); |
2021 | else | 2022 | else |
2022 | dbg("%s - port is closed", __func__); | 2023 | dbg("%s - port is closed", __func__); |
2023 | return; | 2024 | goto out; |
2024 | } | 2025 | } |
2025 | 2026 | ||
2026 | /* urb is completely processed */ | 2027 | /* urb is completely processed */ |
@@ -2041,6 +2042,8 @@ static void ftdi_process_read(struct work_struct *work) | |||
2041 | err("%s - failed resubmitting read urb, error %d", | 2042 | err("%s - failed resubmitting read urb, error %d", |
2042 | __func__, result); | 2043 | __func__, result); |
2043 | } | 2044 | } |
2045 | out: | ||
2046 | tty_kref_put(tty); | ||
2044 | } /* ftdi_process_read */ | 2047 | } /* ftdi_process_read */ |
2045 | 2048 | ||
2046 | 2049 | ||
@@ -2256,7 +2259,7 @@ static int ftdi_tiocmget(struct tty_struct *tty, struct file *file) | |||
2256 | 0, 0, | 2259 | 0, 0, |
2257 | buf, 1, WDR_TIMEOUT); | 2260 | buf, 1, WDR_TIMEOUT); |
2258 | if (ret < 0) { | 2261 | if (ret < 0) { |
2259 | err("%s Could not get modem status of device - err: %d", __func__, | 2262 | dbg("%s Could not get modem status of device - err: %d", __func__, |
2260 | ret); | 2263 | ret); |
2261 | return ret; | 2264 | return ret; |
2262 | } | 2265 | } |
@@ -2275,7 +2278,7 @@ static int ftdi_tiocmget(struct tty_struct *tty, struct file *file) | |||
2275 | 0, priv->interface, | 2278 | 0, priv->interface, |
2276 | buf, 2, WDR_TIMEOUT); | 2279 | buf, 2, WDR_TIMEOUT); |
2277 | if (ret < 0) { | 2280 | if (ret < 0) { |
2278 | err("%s Could not get modem status of device - err: %d", __func__, | 2281 | dbg("%s Could not get modem status of device - err: %d", __func__, |
2279 | ret); | 2282 | ret); |
2280 | return ret; | 2283 | return ret; |
2281 | } | 2284 | } |