Commit 515be7ba authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Greg Kroah-Hartman

tty: Cleanup tty_port_set_initialized() bool parameter

Make callers pass true/false consistently for bool val.
Reviewed-by: default avatarSamuel Iglesias Gonsalvez <siglesias@igalia.com>
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-2-ilpo.jarvinen@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3bec2f77
...@@ -1309,7 +1309,7 @@ static int startup(MGSLPC_INFO * info, struct tty_struct *tty) ...@@ -1309,7 +1309,7 @@ static int startup(MGSLPC_INFO * info, struct tty_struct *tty)
if (tty) if (tty)
clear_bit(TTY_IO_ERROR, &tty->flags); clear_bit(TTY_IO_ERROR, &tty->flags);
tty_port_set_initialized(&info->port, 1); tty_port_set_initialized(&info->port, true);
return 0; return 0;
} }
...@@ -1359,7 +1359,7 @@ static void shutdown(MGSLPC_INFO * info, struct tty_struct *tty) ...@@ -1359,7 +1359,7 @@ static void shutdown(MGSLPC_INFO * info, struct tty_struct *tty)
if (tty) if (tty)
set_bit(TTY_IO_ERROR, &tty->flags); set_bit(TTY_IO_ERROR, &tty->flags);
tty_port_set_initialized(&info->port, 0); tty_port_set_initialized(&info->port, false);
} }
static void mgslpc_program_hw(MGSLPC_INFO *info, struct tty_struct *tty) static void mgslpc_program_hw(MGSLPC_INFO *info, struct tty_struct *tty)
......
...@@ -647,7 +647,7 @@ static void ipoctal_hangup(struct tty_struct *tty) ...@@ -647,7 +647,7 @@ static void ipoctal_hangup(struct tty_struct *tty)
tty_port_hangup(&channel->tty_port); tty_port_hangup(&channel->tty_port);
ipoctal_reset_channel(channel); ipoctal_reset_channel(channel);
tty_port_set_initialized(&channel->tty_port, 0); tty_port_set_initialized(&channel->tty_port, false);
wake_up_interruptible(&channel->tty_port.open_wait); wake_up_interruptible(&channel->tty_port.open_wait);
} }
...@@ -659,7 +659,7 @@ static void ipoctal_shutdown(struct tty_struct *tty) ...@@ -659,7 +659,7 @@ static void ipoctal_shutdown(struct tty_struct *tty)
return; return;
ipoctal_reset_channel(channel); ipoctal_reset_channel(channel);
tty_port_set_initialized(&channel->tty_port, 0); tty_port_set_initialized(&channel->tty_port, false);
} }
static void ipoctal_cleanup(struct tty_struct *tty) static void ipoctal_cleanup(struct tty_struct *tty)
......
...@@ -629,7 +629,7 @@ static int raw3215_startup(struct raw3215_info *raw) ...@@ -629,7 +629,7 @@ static int raw3215_startup(struct raw3215_info *raw)
if (tty_port_initialized(&raw->port)) if (tty_port_initialized(&raw->port))
return 0; return 0;
raw->line_pos = 0; raw->line_pos = 0;
tty_port_set_initialized(&raw->port, 1); tty_port_set_initialized(&raw->port, true);
spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
raw3215_try_io(raw); raw3215_try_io(raw);
spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags); spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags);
...@@ -659,7 +659,7 @@ static void raw3215_shutdown(struct raw3215_info *raw) ...@@ -659,7 +659,7 @@ static void raw3215_shutdown(struct raw3215_info *raw)
spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
remove_wait_queue(&raw->empty_wait, &wait); remove_wait_queue(&raw->empty_wait, &wait);
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
tty_port_set_initialized(&raw->port, 1); tty_port_set_initialized(&raw->port, true);
} }
spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags); spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags);
} }
......
...@@ -502,7 +502,7 @@ static int startup(struct tty_struct *tty, struct serial_state *info) ...@@ -502,7 +502,7 @@ static int startup(struct tty_struct *tty, struct serial_state *info)
*/ */
change_speed(tty, info, NULL); change_speed(tty, info, NULL);
tty_port_set_initialized(port, 1); tty_port_set_initialized(port, true);
local_irq_restore(flags); local_irq_restore(flags);
return 0; return 0;
...@@ -556,7 +556,7 @@ static void shutdown(struct tty_struct *tty, struct serial_state *info) ...@@ -556,7 +556,7 @@ static void shutdown(struct tty_struct *tty, struct serial_state *info)
set_bit(TTY_IO_ERROR, &tty->flags); set_bit(TTY_IO_ERROR, &tty->flags);
tty_port_set_initialized(&info->tport, 0); tty_port_set_initialized(&info->tport, false);
local_irq_restore(flags); local_irq_restore(flags);
} }
......
...@@ -1484,7 +1484,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp) ...@@ -1484,7 +1484,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
MoxaPortLineCtrl(ch, 1, 1); MoxaPortLineCtrl(ch, 1, 1);
MoxaPortEnable(ch); MoxaPortEnable(ch);
MoxaSetFifo(ch, ch->type == PORT_16550A); MoxaSetFifo(ch, ch->type == PORT_16550A);
tty_port_set_initialized(&ch->port, 1); tty_port_set_initialized(&ch->port, true);
} }
mutex_unlock(&ch->port.mutex); mutex_unlock(&ch->port.mutex);
mutex_unlock(&moxa_openlock); mutex_unlock(&moxa_openlock);
......
...@@ -1063,7 +1063,7 @@ static int mxser_set_serial_info(struct tty_struct *tty, ...@@ -1063,7 +1063,7 @@ static int mxser_set_serial_info(struct tty_struct *tty,
} else { } else {
retval = mxser_activate(port, tty); retval = mxser_activate(port, tty);
if (retval == 0) if (retval == 0)
tty_port_set_initialized(port, 1); tty_port_set_initialized(port, true);
} }
mutex_unlock(&port->mutex); mutex_unlock(&port->mutex);
return retval; return retval;
......
...@@ -2059,7 +2059,7 @@ static void gsm_dlci_close(struct gsm_dlci *dlci) ...@@ -2059,7 +2059,7 @@ static void gsm_dlci_close(struct gsm_dlci *dlci)
tty_port_tty_hangup(&dlci->port, false); tty_port_tty_hangup(&dlci->port, false);
gsm_dlci_clear_queues(dlci->gsm, dlci); gsm_dlci_clear_queues(dlci->gsm, dlci);
/* Ensure that gsmtty_open() can return. */ /* Ensure that gsmtty_open() can return. */
tty_port_set_initialized(&dlci->port, 0); tty_port_set_initialized(&dlci->port, false);
wake_up_interruptible(&dlci->port.open_wait); wake_up_interruptible(&dlci->port.open_wait);
} else } else
dlci->gsm->dead = true; dlci->gsm->dead = true;
...@@ -3880,7 +3880,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp) ...@@ -3880,7 +3880,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
dlci->modem_rx = 0; dlci->modem_rx = 0;
/* We could in theory open and close before we wait - eg if we get /* We could in theory open and close before we wait - eg if we get
a DM straight back. This is ok as that will have caused a hangup */ a DM straight back. This is ok as that will have caused a hangup */
tty_port_set_initialized(port, 1); tty_port_set_initialized(port, true);
/* Start sending off SABM messages */ /* Start sending off SABM messages */
if (gsm->initiator) if (gsm->initiator)
gsm_dlci_begin_open(dlci); gsm_dlci_begin_open(dlci);
......
...@@ -290,7 +290,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state) ...@@ -290,7 +290,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)
set_bit(TTY_IO_ERROR, &tty->flags); set_bit(TTY_IO_ERROR, &tty->flags);
if (tty_port_initialized(port)) { if (tty_port_initialized(port)) {
tty_port_set_initialized(port, 0); tty_port_set_initialized(port, false);
/* /*
* Turn off DTR and RTS early. * Turn off DTR and RTS early.
...@@ -2347,7 +2347,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) ...@@ -2347,7 +2347,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
unsigned int mctrl; unsigned int mctrl;
tty_port_set_suspended(port, 1); tty_port_set_suspended(port, 1);
tty_port_set_initialized(port, 0); tty_port_set_initialized(port, false);
spin_lock_irq(&uport->lock); spin_lock_irq(&uport->lock);
ops->stop_tx(uport); ops->stop_tx(uport);
...@@ -2458,7 +2458,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) ...@@ -2458,7 +2458,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
uart_rs485_config(uport); uart_rs485_config(uport);
ops->start_tx(uport); ops->start_tx(uport);
spin_unlock_irq(&uport->lock); spin_unlock_irq(&uport->lock);
tty_port_set_initialized(port, 1); tty_port_set_initialized(port, true);
} else { } else {
/* /*
* Failed to resume - maybe hardware went away? * Failed to resume - maybe hardware went away?
......
...@@ -2354,7 +2354,7 @@ static int startup(struct slgt_info *info) ...@@ -2354,7 +2354,7 @@ static int startup(struct slgt_info *info)
if (info->port.tty) if (info->port.tty)
clear_bit(TTY_IO_ERROR, &info->port.tty->flags); clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
tty_port_set_initialized(&info->port, 1); tty_port_set_initialized(&info->port, true);
return 0; return 0;
} }
...@@ -2401,7 +2401,7 @@ static void shutdown(struct slgt_info *info) ...@@ -2401,7 +2401,7 @@ static void shutdown(struct slgt_info *info)
if (info->port.tty) if (info->port.tty)
set_bit(TTY_IO_ERROR, &info->port.tty->flags); set_bit(TTY_IO_ERROR, &info->port.tty->flags);
tty_port_set_initialized(&info->port, 0); tty_port_set_initialized(&info->port, false);
} }
static void program_hw(struct slgt_info *info) static void program_hw(struct slgt_info *info)
......
...@@ -367,7 +367,7 @@ static void tty_port_shutdown(struct tty_port *port, struct tty_struct *tty) ...@@ -367,7 +367,7 @@ static void tty_port_shutdown(struct tty_port *port, struct tty_struct *tty)
goto out; goto out;
if (tty_port_initialized(port)) { if (tty_port_initialized(port)) {
tty_port_set_initialized(port, 0); tty_port_set_initialized(port, false);
/* /*
* Drop DTR/RTS if HUPCL is set. This causes any attached * Drop DTR/RTS if HUPCL is set. This causes any attached
* modem to hang up the line. * modem to hang up the line.
...@@ -788,7 +788,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty, ...@@ -788,7 +788,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
return retval; return retval;
} }
} }
tty_port_set_initialized(port, 1); tty_port_set_initialized(port, true);
} }
mutex_unlock(&port->mutex); mutex_unlock(&port->mutex);
return tty_port_block_til_ready(port, tty, filp); return tty_port_block_til_ready(port, tty, filp);
......
...@@ -169,7 +169,7 @@ static int usb_console_setup(struct console *co, char *options) ...@@ -169,7 +169,7 @@ static int usb_console_setup(struct console *co, char *options)
tty_save_termios(tty); tty_save_termios(tty);
tty_kref_put(tty); tty_kref_put(tty);
} }
tty_port_set_initialized(&port->port, 1); tty_port_set_initialized(&port->port, true);
} }
/* Now that any required fake tty operations are completed restore /* Now that any required fake tty operations are completed restore
* the tty port count */ * the tty port count */
......
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