Commit 5d420399 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Greg Kroah-Hartman
Browse files

tty: Convert ->dtr_rts() to take bool argument



Convert the raise/on parameter in ->dtr_rts() to bool through the
callchain. The parameter is used like bool. In USB serial, there
remains a few implicit bool -> larger type conversions because some
devices use u8 in their control messages.

In moxa_tiocmget(), dtr variable was reused for line status which
requires int so use a separate variable for status.

Reviewed-by: default avatarJiri Slaby <jirislaby@kernel.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # For MMC
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230117090358.4796-8-ilpo.jarvinen@linux.intel.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b300fb26
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -378,7 +378,7 @@ static void async_mode(MGSLPC_INFO *info);
static void tx_timeout(struct timer_list *t);

static bool carrier_raised(struct tty_port *port);
static void dtr_rts(struct tty_port *port, int onoff);
static void dtr_rts(struct tty_port *port, bool onoff);

#if SYNCLINK_GENERIC_HDLC
#define dev_to_port(D) (dev_to_hdlc(D)->priv)
@@ -2442,7 +2442,7 @@ static bool carrier_raised(struct tty_port *port)
	return info->serial_signals & SerialSignal_DCD;
}

static void dtr_rts(struct tty_port *port, int onoff)
static void dtr_rts(struct tty_port *port, bool onoff)
{
	MGSLPC_INFO *info = container_of(port, MGSLPC_INFO, port);
	unsigned long flags;
+2 −2
Original line number Diff line number Diff line
@@ -548,14 +548,14 @@ static bool uart_carrier_raised(struct tty_port *tport)
 *	adjusted during an open, close and hangup.
 */

static void uart_dtr_rts(struct tty_port *tport, int onoff)
static void uart_dtr_rts(struct tty_port *tport, bool onoff)
{
	struct sdio_uart_port *port =
			container_of(tport, struct sdio_uart_port, port);
	int ret = sdio_uart_claim_func(port);
	if (ret)
		return;
	if (onoff == 0)
	if (!onoff)
		sdio_uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
	else
		sdio_uart_set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
+1 −1
Original line number Diff line number Diff line
@@ -701,7 +701,7 @@ static int gb_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
	return -ENOIOCTLCMD;
}

static void gb_tty_dtr_rts(struct tty_port *port, int on)
static void gb_tty_dtr_rts(struct tty_port *port, bool on)
{
	struct gb_tty *gb_tty;
	u8 newctrl;
+1 −1
Original line number Diff line number Diff line
@@ -1459,7 +1459,7 @@ static bool amiga_carrier_raised(struct tty_port *port)
	return !(ciab.pra & SER_DCD);
}

static void amiga_dtr_rts(struct tty_port *port, int raise)
static void amiga_dtr_rts(struct tty_port *port, bool raise)
{
	struct serial_state *info = container_of(port, struct serial_state,
			tport);
+2 −2
Original line number Diff line number Diff line
@@ -376,7 +376,7 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)
		/* We are ready... raise DTR/RTS */
		if (C_BAUD(tty))
			if (hp->ops->dtr_rts)
				hp->ops->dtr_rts(hp, 1);
				hp->ops->dtr_rts(hp, true);
		tty_port_set_initialized(&hp->port, true);
	}

@@ -406,7 +406,7 @@ static void hvc_close(struct tty_struct *tty, struct file * filp)

		if (C_HUPCL(tty))
			if (hp->ops->dtr_rts)
				hp->ops->dtr_rts(hp, 0);
				hp->ops->dtr_rts(hp, false);

		if (hp->ops->notifier_del)
			hp->ops->notifier_del(hp, hp->data);
Loading