diff options
Diffstat (limited to 'drivers/char/nozomi.c')
-rw-r--r-- | drivers/char/nozomi.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c index 574f1c79b6e6..ec58d8c387ff 100644 --- a/drivers/char/nozomi.c +++ b/drivers/char/nozomi.c | |||
@@ -828,7 +828,7 @@ static int receive_data(enum port_type index, struct nozomi *dc) | |||
828 | struct port *port = &dc->port[index]; | 828 | struct port *port = &dc->port[index]; |
829 | void __iomem *addr = port->dl_addr[port->toggle_dl]; | 829 | void __iomem *addr = port->dl_addr[port->toggle_dl]; |
830 | struct tty_struct *tty = tty_port_tty_get(&port->port); | 830 | struct tty_struct *tty = tty_port_tty_get(&port->port); |
831 | int i; | 831 | int i, ret; |
832 | 832 | ||
833 | if (unlikely(!tty)) { | 833 | if (unlikely(!tty)) { |
834 | DBG1("tty not open for port: %d?", index); | 834 | DBG1("tty not open for port: %d?", index); |
@@ -844,12 +844,14 @@ static int receive_data(enum port_type index, struct nozomi *dc) | |||
844 | 844 | ||
845 | /* disable interrupt in downlink... */ | 845 | /* disable interrupt in downlink... */ |
846 | disable_transmit_dl(index, dc); | 846 | disable_transmit_dl(index, dc); |
847 | return 0; | 847 | ret = 0; |
848 | goto put; | ||
848 | } | 849 | } |
849 | 850 | ||
850 | if (unlikely(size == 0)) { | 851 | if (unlikely(size == 0)) { |
851 | dev_err(&dc->pdev->dev, "size == 0?\n"); | 852 | dev_err(&dc->pdev->dev, "size == 0?\n"); |
852 | return 1; | 853 | ret = 1; |
854 | goto put; | ||
853 | } | 855 | } |
854 | 856 | ||
855 | tty_buffer_request_room(tty, size); | 857 | tty_buffer_request_room(tty, size); |
@@ -871,8 +873,10 @@ static int receive_data(enum port_type index, struct nozomi *dc) | |||
871 | } | 873 | } |
872 | 874 | ||
873 | set_bit(index, &dc->flip); | 875 | set_bit(index, &dc->flip); |
876 | ret = 1; | ||
877 | put: | ||
874 | tty_kref_put(tty); | 878 | tty_kref_put(tty); |
875 | return 1; | 879 | return ret; |
876 | } | 880 | } |
877 | 881 | ||
878 | /* Debug for interrupts */ | 882 | /* Debug for interrupts */ |
@@ -1862,16 +1866,14 @@ static s32 ntty_chars_in_buffer(struct tty_struct *tty) | |||
1862 | { | 1866 | { |
1863 | struct port *port = tty->driver_data; | 1867 | struct port *port = tty->driver_data; |
1864 | struct nozomi *dc = get_dc_by_tty(tty); | 1868 | struct nozomi *dc = get_dc_by_tty(tty); |
1865 | s32 rval; | 1869 | s32 rval = 0; |
1866 | 1870 | ||
1867 | if (unlikely(!dc || !port)) { | 1871 | if (unlikely(!dc || !port)) { |
1868 | rval = -ENODEV; | ||
1869 | goto exit_in_buffer; | 1872 | goto exit_in_buffer; |
1870 | } | 1873 | } |
1871 | 1874 | ||
1872 | if (unlikely(!port->port.count)) { | 1875 | if (unlikely(!port->port.count)) { |
1873 | dev_err(&dc->pdev->dev, "No tty open?\n"); | 1876 | dev_err(&dc->pdev->dev, "No tty open?\n"); |
1874 | rval = -ENODEV; | ||
1875 | goto exit_in_buffer; | 1877 | goto exit_in_buffer; |
1876 | } | 1878 | } |
1877 | 1879 | ||