Commit 9b5aa549 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Greg Kroah-Hartman

tty: Cleanup tty_port_set_active() bool parameter

Make callers pass true/false consistently for bool val.
Reviewed-by: default avatarJiri Slaby <jirislaby@kernel.org>
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230117090358.4796-4-ilpo.jarvinen@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 75b20a2a
...@@ -1329,7 +1329,7 @@ static void rs_hangup(struct tty_struct *tty) ...@@ -1329,7 +1329,7 @@ static void rs_hangup(struct tty_struct *tty)
rs_flush_buffer(tty); rs_flush_buffer(tty);
shutdown(tty, info); shutdown(tty, info);
info->tport.count = 0; info->tport.count = 0;
tty_port_set_active(&info->tport, 0); tty_port_set_active(&info->tport, false);
info->tport.tty = NULL; info->tport.tty = NULL;
wake_up_interruptible(&info->tport.open_wait); wake_up_interruptible(&info->tport.open_wait);
} }
......
...@@ -1827,7 +1827,7 @@ static void uart_hangup(struct tty_struct *tty) ...@@ -1827,7 +1827,7 @@ static void uart_hangup(struct tty_struct *tty)
spin_lock_irqsave(&port->lock, flags); spin_lock_irqsave(&port->lock, flags);
port->count = 0; port->count = 0;
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
tty_port_set_active(port, 0); tty_port_set_active(port, false);
tty_port_tty_set(port, NULL); tty_port_tty_set(port, NULL);
if (uport && !uart_console(uport)) if (uport && !uart_console(uport))
uart_change_pm(state, UART_PM_STATE_OFF); uart_change_pm(state, UART_PM_STATE_OFF);
...@@ -1945,7 +1945,7 @@ static int uart_port_activate(struct tty_port *port, struct tty_struct *tty) ...@@ -1945,7 +1945,7 @@ static int uart_port_activate(struct tty_port *port, struct tty_struct *tty)
*/ */
ret = uart_startup(tty, state, 0); ret = uart_startup(tty, state, 0);
if (ret > 0) if (ret > 0)
tty_port_set_active(port, 1); tty_port_set_active(port, true);
return ret; return ret;
} }
......
...@@ -694,7 +694,7 @@ static void hangup(struct tty_struct *tty) ...@@ -694,7 +694,7 @@ static void hangup(struct tty_struct *tty)
info->port.count = 0; info->port.count = 0;
info->port.tty = NULL; info->port.tty = NULL;
spin_unlock_irqrestore(&info->port.lock, flags); spin_unlock_irqrestore(&info->port.lock, flags);
tty_port_set_active(&info->port, 0); tty_port_set_active(&info->port, false);
mutex_unlock(&info->port.mutex); mutex_unlock(&info->port.mutex);
wake_up_interruptible(&info->port.open_wait); wake_up_interruptible(&info->port.open_wait);
...@@ -3169,7 +3169,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, ...@@ -3169,7 +3169,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
if (filp->f_flags & O_NONBLOCK || tty_io_error(tty)) { if (filp->f_flags & O_NONBLOCK || tty_io_error(tty)) {
/* nonblock mode is set or port is not enabled */ /* nonblock mode is set or port is not enabled */
tty_port_set_active(port, 1); tty_port_set_active(port, true);
return 0; return 0;
} }
...@@ -3226,7 +3226,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, ...@@ -3226,7 +3226,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
port->blocked_open--; port->blocked_open--;
if (!retval) if (!retval)
tty_port_set_active(port, 1); tty_port_set_active(port, true);
DBGINFO(("%s block_til_ready ready, rc=%d\n", tty->driver->name, retval)); DBGINFO(("%s block_til_ready ready, rc=%d\n", tty->driver->name, retval));
return retval; return retval;
......
...@@ -403,7 +403,7 @@ void tty_port_hangup(struct tty_port *port) ...@@ -403,7 +403,7 @@ void tty_port_hangup(struct tty_port *port)
set_bit(TTY_IO_ERROR, &tty->flags); set_bit(TTY_IO_ERROR, &tty->flags);
port->tty = NULL; port->tty = NULL;
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
tty_port_set_active(port, 0); tty_port_set_active(port, false);
tty_port_shutdown(port, tty); tty_port_shutdown(port, tty);
tty_kref_put(tty); tty_kref_put(tty);
wake_up_interruptible(&port->open_wait); wake_up_interruptible(&port->open_wait);
...@@ -518,14 +518,14 @@ int tty_port_block_til_ready(struct tty_port *port, ...@@ -518,14 +518,14 @@ int tty_port_block_til_ready(struct tty_port *port,
* the port has just hung up or is in another error state. * the port has just hung up or is in another error state.
*/ */
if (tty_io_error(tty)) { if (tty_io_error(tty)) {
tty_port_set_active(port, 1); tty_port_set_active(port, true);
return 0; return 0;
} }
if (filp == NULL || (filp->f_flags & O_NONBLOCK)) { if (filp == NULL || (filp->f_flags & O_NONBLOCK)) {
/* Indicate we are open */ /* Indicate we are open */
if (C_BAUD(tty)) if (C_BAUD(tty))
tty_port_raise_dtr_rts(port); tty_port_raise_dtr_rts(port);
tty_port_set_active(port, 1); tty_port_set_active(port, true);
return 0; return 0;
} }
...@@ -588,7 +588,7 @@ int tty_port_block_til_ready(struct tty_port *port, ...@@ -588,7 +588,7 @@ int tty_port_block_til_ready(struct tty_port *port,
port->blocked_open--; port->blocked_open--;
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
if (retval == 0) if (retval == 0)
tty_port_set_active(port, 1); tty_port_set_active(port, true);
return retval; return retval;
} }
EXPORT_SYMBOL(tty_port_block_til_ready); EXPORT_SYMBOL(tty_port_block_til_ready);
...@@ -695,7 +695,7 @@ void tty_port_close_end(struct tty_port *port, struct tty_struct *tty) ...@@ -695,7 +695,7 @@ void tty_port_close_end(struct tty_port *port, struct tty_struct *tty)
wake_up_interruptible(&port->open_wait); wake_up_interruptible(&port->open_wait);
} }
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
tty_port_set_active(port, 0); tty_port_set_active(port, false);
} }
EXPORT_SYMBOL(tty_port_close_end); EXPORT_SYMBOL(tty_port_close_end);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment