diff options
author | Jiri Slaby <jslaby@suse.cz> | 2013-03-07 07:12:29 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-18 19:19:45 -0400 |
commit | 6aad04f21374633bd8cecf25024553d1e11a9522 (patch) | |
tree | 9e3351e53b68d158b436a737049cbe2ee01ff126 /drivers/tty/nozomi.c | |
parent | 6982a398426a22166eaf049b79544536fdd6429f (diff) |
TTY: add tty_port_tty_wakeup helper
It allows for cleaning up on a considerable amount of places. They did
port_get, wakeup, kref_put. Now the only thing needed is to call
tty_port_tty_wakeup which does exactly that.
One exception is ifx6x60 where tty_wakeup was open-coded. We now call
tty_wakeup properly there.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/nozomi.c')
-rw-r--r-- | drivers/tty/nozomi.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c index 2dff19796157..2e5bbdc09e1c 100644 --- a/drivers/tty/nozomi.c +++ b/drivers/tty/nozomi.c | |||
@@ -791,7 +791,6 @@ static int send_data(enum port_type index, struct nozomi *dc) | |||
791 | const u8 toggle = port->toggle_ul; | 791 | const u8 toggle = port->toggle_ul; |
792 | void __iomem *addr = port->ul_addr[toggle]; | 792 | void __iomem *addr = port->ul_addr[toggle]; |
793 | const u32 ul_size = port->ul_size[toggle]; | 793 | const u32 ul_size = port->ul_size[toggle]; |
794 | struct tty_struct *tty = tty_port_tty_get(&port->port); | ||
795 | 794 | ||
796 | /* Get data from tty and place in buf for now */ | 795 | /* Get data from tty and place in buf for now */ |
797 | size = kfifo_out(&port->fifo_ul, dc->send_buf, | 796 | size = kfifo_out(&port->fifo_ul, dc->send_buf, |
@@ -799,7 +798,6 @@ static int send_data(enum port_type index, struct nozomi *dc) | |||
799 | 798 | ||
800 | if (size == 0) { | 799 | if (size == 0) { |
801 | DBG4("No more data to send, disable link:"); | 800 | DBG4("No more data to send, disable link:"); |
802 | tty_kref_put(tty); | ||
803 | return 0; | 801 | return 0; |
804 | } | 802 | } |
805 | 803 | ||
@@ -809,10 +807,8 @@ static int send_data(enum port_type index, struct nozomi *dc) | |||
809 | write_mem32(addr, (u32 *) &size, 4); | 807 | write_mem32(addr, (u32 *) &size, 4); |
810 | write_mem32(addr + 4, (u32 *) dc->send_buf, size); | 808 | write_mem32(addr + 4, (u32 *) dc->send_buf, size); |
811 | 809 | ||
812 | if (tty) | 810 | tty_port_tty_wakeup(&port->port); |
813 | tty_wakeup(tty); | ||
814 | 811 | ||
815 | tty_kref_put(tty); | ||
816 | return 1; | 812 | return 1; |
817 | } | 813 | } |
818 | 814 | ||