提交 5701cb8b 编写于 作者: I Ilpo Järvinen 提交者: Greg Kroah-Hartman

tty: Call ->dtr_rts() parameter active consistently

Convert various parameter names for ->dtr_rts() and related functions
from onoff, on, and raise to active.
Reviewed-by: NJiri Slaby <jirislaby@kernel.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # For MMC
Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230117090358.4796-12-ilpo.jarvinen@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 87f22db4
...@@ -378,7 +378,7 @@ static void async_mode(MGSLPC_INFO *info); ...@@ -378,7 +378,7 @@ static void async_mode(MGSLPC_INFO *info);
static void tx_timeout(struct timer_list *t); static void tx_timeout(struct timer_list *t);
static bool carrier_raised(struct tty_port *port); static bool carrier_raised(struct tty_port *port);
static void dtr_rts(struct tty_port *port, bool onoff); static void dtr_rts(struct tty_port *port, bool active);
#if SYNCLINK_GENERIC_HDLC #if SYNCLINK_GENERIC_HDLC
#define dev_to_port(D) (dev_to_hdlc(D)->priv) #define dev_to_port(D) (dev_to_hdlc(D)->priv)
...@@ -2442,13 +2442,13 @@ static bool carrier_raised(struct tty_port *port) ...@@ -2442,13 +2442,13 @@ static bool carrier_raised(struct tty_port *port)
return info->serial_signals & SerialSignal_DCD; return info->serial_signals & SerialSignal_DCD;
} }
static void dtr_rts(struct tty_port *port, bool onoff) static void dtr_rts(struct tty_port *port, bool active)
{ {
MGSLPC_INFO *info = container_of(port, MGSLPC_INFO, port); MGSLPC_INFO *info = container_of(port, MGSLPC_INFO, port);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&info->lock, flags); spin_lock_irqsave(&info->lock, flags);
if (onoff) if (active)
info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR;
else else
info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
......
...@@ -542,20 +542,20 @@ static bool uart_carrier_raised(struct tty_port *tport) ...@@ -542,20 +542,20 @@ static bool uart_carrier_raised(struct tty_port *tport)
/** /**
* uart_dtr_rts - port helper to set uart signals * uart_dtr_rts - port helper to set uart signals
* @tport: tty port to be updated * @tport: tty port to be updated
* @onoff: set to turn on DTR/RTS * @active: set to turn on DTR/RTS
* *
* Called by the tty port helpers when the modem signals need to be * Called by the tty port helpers when the modem signals need to be
* adjusted during an open, close and hangup. * adjusted during an open, close and hangup.
*/ */
static void uart_dtr_rts(struct tty_port *tport, bool onoff) static void uart_dtr_rts(struct tty_port *tport, bool active)
{ {
struct sdio_uart_port *port = struct sdio_uart_port *port =
container_of(tport, struct sdio_uart_port, port); container_of(tport, struct sdio_uart_port, port);
int ret = sdio_uart_claim_func(port); int ret = sdio_uart_claim_func(port);
if (ret) if (ret)
return; return;
if (!onoff) if (!active)
sdio_uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); sdio_uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
else else
sdio_uart_set_mctrl(port, TIOCM_DTR | TIOCM_RTS); sdio_uart_set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
......
...@@ -701,7 +701,7 @@ static int gb_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -701,7 +701,7 @@ static int gb_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
static void gb_tty_dtr_rts(struct tty_port *port, bool on) static void gb_tty_dtr_rts(struct tty_port *port, bool active)
{ {
struct gb_tty *gb_tty; struct gb_tty *gb_tty;
u8 newctrl; u8 newctrl;
...@@ -709,7 +709,7 @@ static void gb_tty_dtr_rts(struct tty_port *port, bool on) ...@@ -709,7 +709,7 @@ static void gb_tty_dtr_rts(struct tty_port *port, bool on)
gb_tty = container_of(port, struct gb_tty, port); gb_tty = container_of(port, struct gb_tty, port);
newctrl = gb_tty->ctrlout; newctrl = gb_tty->ctrlout;
if (on) if (active)
newctrl |= (GB_UART_CTRL_DTR | GB_UART_CTRL_RTS); newctrl |= (GB_UART_CTRL_DTR | GB_UART_CTRL_RTS);
else else
newctrl &= ~(GB_UART_CTRL_DTR | GB_UART_CTRL_RTS); newctrl &= ~(GB_UART_CTRL_DTR | GB_UART_CTRL_RTS);
......
...@@ -1459,13 +1459,13 @@ static bool amiga_carrier_raised(struct tty_port *port) ...@@ -1459,13 +1459,13 @@ static bool amiga_carrier_raised(struct tty_port *port)
return !(ciab.pra & SER_DCD); return !(ciab.pra & SER_DCD);
} }
static void amiga_dtr_rts(struct tty_port *port, bool raise) static void amiga_dtr_rts(struct tty_port *port, bool active)
{ {
struct serial_state *info = container_of(port, struct serial_state, struct serial_state *info = container_of(port, struct serial_state,
tport); tport);
unsigned long flags; unsigned long flags;
if (raise) if (active)
info->MCR |= SER_DTR|SER_RTS; info->MCR |= SER_DTR|SER_RTS;
else else
info->MCR &= ~(SER_DTR|SER_RTS); info->MCR &= ~(SER_DTR|SER_RTS);
......
...@@ -66,7 +66,7 @@ struct hv_ops { ...@@ -66,7 +66,7 @@ struct hv_ops {
int (*tiocmset)(struct hvc_struct *hp, unsigned int set, unsigned int clear); int (*tiocmset)(struct hvc_struct *hp, unsigned int set, unsigned int clear);
/* Callbacks to handle tty ports */ /* Callbacks to handle tty ports */
void (*dtr_rts)(struct hvc_struct *hp, bool raise); void (*dtr_rts)(struct hvc_struct *hp, bool active);
}; };
/* Register a vterm and a slot index for use as a console (console_init) */ /* Register a vterm and a slot index for use as a console (console_init) */
......
...@@ -658,13 +658,13 @@ static void hvc_iucv_notifier_hangup(struct hvc_struct *hp, int id) ...@@ -658,13 +658,13 @@ static void hvc_iucv_notifier_hangup(struct hvc_struct *hp, int id)
/** /**
* hvc_iucv_dtr_rts() - HVC notifier for handling DTR/RTS * hvc_iucv_dtr_rts() - HVC notifier for handling DTR/RTS
* @hp: Pointer the HVC device (struct hvc_struct) * @hp: Pointer the HVC device (struct hvc_struct)
* @raise: True to raise or false to lower DTR/RTS lines * @active: True to raise or false to lower DTR/RTS lines
* *
* This routine notifies the HVC back-end to raise or lower DTR/RTS * This routine notifies the HVC back-end to raise or lower DTR/RTS
* lines. Raising DTR/RTS is ignored. Lowering DTR/RTS indicates to * lines. Raising DTR/RTS is ignored. Lowering DTR/RTS indicates to
* drop the IUCV connection (similar to hang up the modem). * drop the IUCV connection (similar to hang up the modem).
*/ */
static void hvc_iucv_dtr_rts(struct hvc_struct *hp, bool raise) static void hvc_iucv_dtr_rts(struct hvc_struct *hp, bool active)
{ {
struct hvc_iucv_private *priv; struct hvc_iucv_private *priv;
struct iucv_path *path; struct iucv_path *path;
...@@ -672,7 +672,7 @@ static void hvc_iucv_dtr_rts(struct hvc_struct *hp, bool raise) ...@@ -672,7 +672,7 @@ static void hvc_iucv_dtr_rts(struct hvc_struct *hp, bool raise)
/* Raising the DTR/RTS is ignored as IUCV connections can be /* Raising the DTR/RTS is ignored as IUCV connections can be
* established at any times. * established at any times.
*/ */
if (raise) if (active)
return; return;
priv = hvc_iucv_get_private(hp->vtermno); priv = hvc_iucv_get_private(hp->vtermno);
......
...@@ -465,7 +465,7 @@ static bool mxser_carrier_raised(struct tty_port *port) ...@@ -465,7 +465,7 @@ static bool mxser_carrier_raised(struct tty_port *port)
return inb(mp->ioaddr + UART_MSR) & UART_MSR_DCD; return inb(mp->ioaddr + UART_MSR) & UART_MSR_DCD;
} }
static void mxser_dtr_rts(struct tty_port *port, bool on) static void mxser_dtr_rts(struct tty_port *port, bool active)
{ {
struct mxser_port *mp = container_of(port, struct mxser_port, port); struct mxser_port *mp = container_of(port, struct mxser_port, port);
unsigned long flags; unsigned long flags;
...@@ -473,7 +473,7 @@ static void mxser_dtr_rts(struct tty_port *port, bool on) ...@@ -473,7 +473,7 @@ static void mxser_dtr_rts(struct tty_port *port, bool on)
spin_lock_irqsave(&mp->slock, flags); spin_lock_irqsave(&mp->slock, flags);
mcr = inb(mp->ioaddr + UART_MCR); mcr = inb(mp->ioaddr + UART_MCR);
if (on) if (active)
mcr |= UART_MCR_DTR | UART_MCR_RTS; mcr |= UART_MCR_DTR | UART_MCR_RTS;
else else
mcr &= ~(UART_MCR_DTR | UART_MCR_RTS); mcr &= ~(UART_MCR_DTR | UART_MCR_RTS);
......
...@@ -3792,11 +3792,11 @@ static bool gsm_carrier_raised(struct tty_port *port) ...@@ -3792,11 +3792,11 @@ static bool gsm_carrier_raised(struct tty_port *port)
return dlci->modem_rx & TIOCM_CD; return dlci->modem_rx & TIOCM_CD;
} }
static void gsm_dtr_rts(struct tty_port *port, bool onoff) static void gsm_dtr_rts(struct tty_port *port, bool active)
{ {
struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port); struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port);
unsigned int modem_tx = dlci->modem_tx; unsigned int modem_tx = dlci->modem_tx;
if (onoff) if (active)
modem_tx |= TIOCM_DTR | TIOCM_RTS; modem_tx |= TIOCM_DTR | TIOCM_RTS;
else else
modem_tx &= ~(TIOCM_DTR | TIOCM_RTS); modem_tx &= ~(TIOCM_DTR | TIOCM_RTS);
......
...@@ -169,9 +169,9 @@ uart_update_mctrl(struct uart_port *port, unsigned int set, unsigned int clear) ...@@ -169,9 +169,9 @@ uart_update_mctrl(struct uart_port *port, unsigned int set, unsigned int clear)
#define uart_set_mctrl(port, set) uart_update_mctrl(port, set, 0) #define uart_set_mctrl(port, set) uart_update_mctrl(port, set, 0)
#define uart_clear_mctrl(port, clear) uart_update_mctrl(port, 0, clear) #define uart_clear_mctrl(port, clear) uart_update_mctrl(port, 0, clear)
static void uart_port_dtr_rts(struct uart_port *uport, bool raise) static void uart_port_dtr_rts(struct uart_port *uport, bool active)
{ {
if (raise) if (active)
uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS); uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
else else
uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS); uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
...@@ -1885,7 +1885,7 @@ static bool uart_carrier_raised(struct tty_port *port) ...@@ -1885,7 +1885,7 @@ static bool uart_carrier_raised(struct tty_port *port)
return mctrl & TIOCM_CAR; return mctrl & TIOCM_CAR;
} }
static void uart_dtr_rts(struct tty_port *port, bool raise) static void uart_dtr_rts(struct tty_port *port, bool active)
{ {
struct uart_state *state = container_of(port, struct uart_state, port); struct uart_state *state = container_of(port, struct uart_state, port);
struct uart_port *uport; struct uart_port *uport;
...@@ -1893,7 +1893,7 @@ static void uart_dtr_rts(struct tty_port *port, bool raise) ...@@ -1893,7 +1893,7 @@ static void uart_dtr_rts(struct tty_port *port, bool raise)
uport = uart_port_ref(state); uport = uart_port_ref(state);
if (!uport) if (!uport)
return; return;
uart_port_dtr_rts(uport, raise); uart_port_dtr_rts(uport, active);
uart_port_deref(uport); uart_port_deref(uport);
} }
......
...@@ -3138,13 +3138,13 @@ static bool carrier_raised(struct tty_port *port) ...@@ -3138,13 +3138,13 @@ static bool carrier_raised(struct tty_port *port)
return info->signals & SerialSignal_DCD; return info->signals & SerialSignal_DCD;
} }
static void dtr_rts(struct tty_port *port, bool on) static void dtr_rts(struct tty_port *port, bool active)
{ {
unsigned long flags; unsigned long flags;
struct slgt_info *info = container_of(port, struct slgt_info, port); struct slgt_info *info = container_of(port, struct slgt_info, port);
spin_lock_irqsave(&info->lock,flags); spin_lock_irqsave(&info->lock,flags);
if (on) if (active)
info->signals |= SerialSignal_RTS | SerialSignal_DTR; info->signals |= SerialSignal_RTS | SerialSignal_DTR;
else else
info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR); info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
......
...@@ -651,13 +651,13 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) ...@@ -651,13 +651,13 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
return tty_port_open(&acm->port, tty, filp); return tty_port_open(&acm->port, tty, filp);
} }
static void acm_port_dtr_rts(struct tty_port *port, bool raise) static void acm_port_dtr_rts(struct tty_port *port, bool active)
{ {
struct acm *acm = container_of(port, struct acm, port); struct acm *acm = container_of(port, struct acm, port);
int val; int val;
int res; int res;
if (raise) if (active)
val = USB_CDC_CTRL_DTR | USB_CDC_CTRL_RTS; val = USB_CDC_CTRL_DTR | USB_CDC_CTRL_RTS;
else else
val = 0; val = 0;
......
...@@ -16,7 +16,7 @@ struct tty_struct; ...@@ -16,7 +16,7 @@ struct tty_struct;
/** /**
* struct tty_port_operations -- operations on tty_port * struct tty_port_operations -- operations on tty_port
* @carrier_raised: return true if the carrier is raised on @port * @carrier_raised: return true if the carrier is raised on @port
* @dtr_rts: raise the DTR line if @raise is true, otherwise lower DTR * @dtr_rts: raise the DTR line if @active is true, otherwise lower DTR
* @shutdown: called when the last close completes or a hangup finishes IFF the * @shutdown: called when the last close completes or a hangup finishes IFF the
* port was initialized. Do not use to free resources. Turn off the device * port was initialized. Do not use to free resources. Turn off the device
* only. Called under the port mutex to serialize against @activate and * only. Called under the port mutex to serialize against @activate and
...@@ -32,7 +32,7 @@ struct tty_struct; ...@@ -32,7 +32,7 @@ struct tty_struct;
*/ */
struct tty_port_operations { struct tty_port_operations {
bool (*carrier_raised)(struct tty_port *port); bool (*carrier_raised)(struct tty_port *port);
void (*dtr_rts)(struct tty_port *port, bool raise); void (*dtr_rts)(struct tty_port *port, bool active);
void (*shutdown)(struct tty_port *port); void (*shutdown)(struct tty_port *port);
int (*activate)(struct tty_port *port, struct tty_struct *tty); int (*activate)(struct tty_port *port, struct tty_struct *tty);
void (*destruct)(struct tty_port *port); void (*destruct)(struct tty_port *port);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册