aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2013-03-07 07:12:30 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-18 19:24:29 -0400
commitaa27a094e2c2e0cc59914e56113b860f524f4479 (patch)
treeb3cfef8d8023741107e3d3bed934f2bd4d8bf189 /drivers/mmc/card
parente4408ce3c23f8451eff7a2954694598fb8fce833 (diff)
TTY: add tty_port_tty_hangup helper
It allows for cleaning up on a considerable amount of places. They did port_get, hangup, kref_put. Now the only thing needed is to call tty_port_tty_hangup which does exactly that. And they can also decide whether to consider CLOCAL or completely ignore that. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mmc/card')
-rw-r--r--drivers/mmc/card/sdio_uart.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/mmc/card/sdio_uart.c b/drivers/mmc/card/sdio_uart.c
index c931dfe6a59c..f093cea0d060 100644
--- a/drivers/mmc/card/sdio_uart.c
+++ b/drivers/mmc/card/sdio_uart.c
@@ -134,7 +134,6 @@ static void sdio_uart_port_put(struct sdio_uart_port *port)
134static void sdio_uart_port_remove(struct sdio_uart_port *port) 134static void sdio_uart_port_remove(struct sdio_uart_port *port)
135{ 135{
136 struct sdio_func *func; 136 struct sdio_func *func;
137 struct tty_struct *tty;
138 137
139 BUG_ON(sdio_uart_table[port->index] != port); 138 BUG_ON(sdio_uart_table[port->index] != port);
140 139
@@ -155,12 +154,8 @@ static void sdio_uart_port_remove(struct sdio_uart_port *port)
155 sdio_claim_host(func); 154 sdio_claim_host(func);
156 port->func = NULL; 155 port->func = NULL;
157 mutex_unlock(&port->func_lock); 156 mutex_unlock(&port->func_lock);
158 tty = tty_port_tty_get(&port->port);
159 /* tty_hangup is async so is this safe as is ?? */ 157 /* tty_hangup is async so is this safe as is ?? */
160 if (tty) { 158 tty_port_tty_hangup(&port->port, false);
161 tty_hangup(tty);
162 tty_kref_put(tty);
163 }
164 mutex_unlock(&port->port.mutex); 159 mutex_unlock(&port->port.mutex);
165 sdio_release_irq(func); 160 sdio_release_irq(func);
166 sdio_disable_func(func); 161 sdio_disable_func(func);
@@ -492,11 +487,7 @@ static void sdio_uart_check_modem_status(struct sdio_uart_port *port)
492 wake_up_interruptible(&port->port.open_wait); 487 wake_up_interruptible(&port->port.open_wait);
493 else { 488 else {
494 /* DCD drop - hang up if tty attached */ 489 /* DCD drop - hang up if tty attached */
495 tty = tty_port_tty_get(&port->port); 490 tty_port_tty_hangup(&port->port, false);
496 if (tty) {
497 tty_hangup(tty);
498 tty_kref_put(tty);
499 }
500 } 491 }
501 } 492 }
502 if (status & UART_MSR_DCTS) { 493 if (status & UART_MSR_DCTS) {