Skip to contentSkip to conversation

use setup_timer() helper function.

PATCH In review Allen Pais 2 participants 12 messages Sep 22, 2017

Subsystems (3)
lore
Share & tools
lore

Allen Pais

author
#0 lore raw

cover use setup_timer() helper function.

This series uses setup_timer() helper function. The series addresses the files under drivers/tty/*.

Allen Pais (10):
drivers: tty: mux: use setup_timer() helper. drivers:tty: imx: use setup_timer() helper.
drivers: tty: vcc: use setup_timer() helper.
drivers: tty: max3100: use setup_timer() helper.
drivers: tty: pnx8xxx: use setup_timer() helper.
drivers: tty: 8250: use setup_timer() helper.
drivers: tty: sa1100: use setup_timer() helper.
drivers: tty: n_gsm: use setup_timer() helper.
drivers: tty: sn_console: use setup_timer() helper.
drivers: tty: ifx6x60: use setup_timer() helper.

 drivers/tty/n_gsm.c                 | 4 +---
 drivers/tty/serial/8250/8250_core.c | 3 +--
 drivers/tty/serial/ifx6x60.c        | 5 ++---
 drivers/tty/serial/imx.c            | 4 +---
 drivers/tty/serial/max3100.c        | 5 ++---
 drivers/tty/serial/mux.c            | 3 +--
 drivers/tty/serial/pnx8xxx_uart.c   | 5 ++---
 drivers/tty/serial/sa1100.c         | 5 ++---
 drivers/tty/serial/sn_console.c     | 4 +---
 drivers/tty/vcc.c                   | 9 ++-------
 10 files changed, 15 insertions(+), 32 deletions(-)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/10 drivers: tty: mux: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/tty/serial/mux.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/mux.c +1 -2
index 2bff69e..a789837 100644
@@ -576,8 +576,7 @@ static int __init mux_init(void)
 
 	if(port_cnt > 0) {
 		/* Start the Mux timer */
-		init_timer(&mux_timer);
-		mux_timer.function = mux_poll;
+		setup_timer(&mux_timer, mux_poll, 0UL);
 		mod_timer(&mux_timer, jiffies + MUX_POLL_DELAY);
 
 #ifdef CONFIG_SERIAL_MUX_CONSOLE
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 2/10 drivers:tty: imx: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/tty/serial/imx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/imx.c +1 -3
index dfeff39..64f57c6 100644
@@ -2115,9 +2115,7 @@ static int serial_imx_probe(struct platform_device *pdev)
 	sport->port.rs485.flags =
 		SER_RS485_RTS_ON_SEND | SER_RS485_RX_DURING_TX;
 	sport->port.flags = UPF_BOOT_AUTOCONF;
-	init_timer(&sport->timer);
-	sport->timer.function = imx_timeout;
-	sport->timer.data     = (unsigned long)sport;
+	setup_timer(&sport->timer, imx_timeout, (unsigned long)sport);
 
 	sport->gpios = mctrl_gpio_init(&sport->port, 0);
 	if (IS_ERR(sport->gpios))
Signature · 1 line
2.7.4
author
#4 lore raw

PATCH 3/10 drivers: tty: vcc: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/tty/vcc.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/tty/vcc.c +2 -7
index ef01d24..954b190 100644
@@ -645,13 +645,8 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
 	if (rv)
 		goto free_domain;
 
-	init_timer(&port->rx_timer);
-	port->rx_timer.function = vcc_rx_timer;
-	port->rx_timer.data = port->index;
-
-	init_timer(&port->tx_timer);
-	port->tx_timer.function = vcc_tx_timer;
-	port->tx_timer.data = port->index;
+	setup_timer(&port->rx_timer, vcc_rx_timer, port->index);
+	setup_timer(&port->tx_timer, vcc_tx_timer, port->index);
 
 	dev_set_drvdata(&vdev->dev, port);
 
Signature · 1 line
2.7.4
author
#5 lore raw

PATCH 4/10 drivers: tty: max3100: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/tty/serial/max3100.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/tty/serial/max3100.c +2 -3
index ace8264..b6b3453 100644
@@ -787,9 +787,8 @@ static int max3100_probe(struct spi_device *spi)
 		max3100s[i]->poll_time = 1;
 	max3100s[i]->max3100_hw_suspend = pdata->max3100_hw_suspend;
 	max3100s[i]->minor = i;
-	init_timer(&max3100s[i]->timer);
-	max3100s[i]->timer.function = max3100_timeout;
-	max3100s[i]->timer.data = (unsigned long) max3100s[i];
+	setup_timer(&max3100s[i]->timer, max3100_timeout,
+		    (unsigned long)max3100s[i]);
 
 	dev_dbg(&spi->dev, "%s: adding port %d\n", __func__, i);
 	max3100s[i]->port.irq = max3100s[i]->irq;
Signature · 1 line
2.7.4
author
#6 lore raw

PATCH 5/10 drivers: tty: pnx8xxx: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/tty/serial/pnx8xxx_uart.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/tty/serial/pnx8xxx_uart.c +2 -3
index dab2668..a05508a 100644
@@ -666,9 +666,8 @@ static void __init pnx8xxx_init_ports(void)
 	first = 0;
 
 	for (i = 0; i < NR_PORTS; i++) {
-		init_timer(&pnx8xxx_ports[i].timer);
-		pnx8xxx_ports[i].timer.function = pnx8xxx_timeout;
-		pnx8xxx_ports[i].timer.data     = (unsigned long)&pnx8xxx_ports[i];
+		setup_timer(&pnx8xxx_ports[i].timer, pnx8xxx_timeout,
+			    (unsigned long)&pnx8xxx_ports[i]);
 		pnx8xxx_ports[i].port.ops = &pnx8xxx_pops;
 	}
 }
Signature · 1 line
2.7.4
author
#7 lore raw

PATCH 6/10 drivers: tty: 8250: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/tty/serial/8250/8250_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/8250/8250_core.c +1 -2
index d29b512a..00d4b11 100644
@@ -525,8 +525,7 @@ static void __init serial8250_isa_init_ports(void)
 			base_ops = port->ops;
 		port->ops = &univ8250_port_ops;
 
-		init_timer(&up->timer);
-		up->timer.function = serial8250_timeout;
+		setup_timer(&up->timer, serial8250_timeout, 0UL);
 
 		up->ops = &univ8250_driver_ops;
 
Signature · 1 line
2.7.4
author
#8 lore raw

PATCH 7/10 drivers: tty: sa1100: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/tty/serial/sa1100.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/tty/serial/sa1100.c +2 -3
index fd3d132..75bd1e0 100644
@@ -640,9 +640,8 @@ static void __init sa1100_init_ports(void)
 		sa1100_ports[i].port.fifosize  = 8;
 		sa1100_ports[i].port.line      = i;
 		sa1100_ports[i].port.iotype    = UPIO_MEM;
-		init_timer(&sa1100_ports[i].timer);
-		sa1100_ports[i].timer.function = sa1100_timeout;
-		sa1100_ports[i].timer.data     = (unsigned long)&sa1100_ports[i];
+		setup_timer(&sa1100_ports[i].timer, sa1100_timeout,
+			    (unsigned long)&sa1100_ports[i]);
 	}
 
 	/*
Signature · 1 line
2.7.4
author
#9 lore raw

PATCH 8/10 drivers: tty: n_gsm: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/tty/n_gsm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/n_gsm.c +1 -3
index 0a3c966..33530d8 100644
@@ -1646,9 +1646,7 @@ static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr)
 	}
 
 	skb_queue_head_init(&dlci->skb_list);
-	init_timer(&dlci->t1);
-	dlci->t1.function = gsm_dlci_t1;
-	dlci->t1.data = (unsigned long)dlci;
+	setup_timer(&dlci->t1, gsm_dlci_t1, (unsigned long)dlci);
 	tty_port_init(&dlci->port);
 	dlci->port.ops = &gsm_port_ops;
 	dlci->gsm = gsm;
Signature · 1 line
2.7.4
author
#10 lore raw

PATCH 9/10 drivers: tty: sn_console: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/tty/serial/sn_console.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/sn_console.c +1 -3
index 9e0e658..81d506d2 100644
@@ -687,9 +687,7 @@ static void __init sn_sal_switch_to_asynch(struct sn_cons_port *port)
 	 * timer to poll for input and push data from the console
 	 * buffer.
 	 */
-	init_timer(&port->sc_timer);
-	port->sc_timer.function = sn_sal_timer_poll;
-	port->sc_timer.data = (unsigned long)port;
+	setup_timer(&port->sc_timer, sn_sal_timer_poll, (unsigned long)port);
 
 	if (IS_RUNNING_ON_SIMULATOR())
 		port->sc_interrupt_timeout = 6;
Signature · 1 line
2.7.4
author
#11 lore raw

PATCH 10/10 drivers: tty: ifx6x60: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/tty/serial/ifx6x60.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/tty/serial/ifx6x60.c +2 -3
index f190a84..596b738 100644
@@ -1029,9 +1029,8 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
 	spin_lock_init(&ifx_dev->write_lock);
 	spin_lock_init(&ifx_dev->power_lock);
 	ifx_dev->power_status = 0;
-	init_timer(&ifx_dev->spi_timer);
-	ifx_dev->spi_timer.function = ifx_spi_timeout;
-	ifx_dev->spi_timer.data = (unsigned long)ifx_dev;
+	setup_timer(&ifx_dev->spi_timer, ifx_spi_timeout,
+		    (unsigned long)ifx_dev);
 	ifx_dev->modem = pl_data->modem_type;
 	ifx_dev->use_dma = pl_data->use_dma;
 	ifx_dev->max_hz = pl_data->max_hz;
Signature · 1 line
2.7.4
Acked-by on v1 2/10
#3 lore raw

Re: [PATCH 02/10] drivers:tty: imx: use setup_timer() helper.

In reply to Allen Pais

Hello,

$Subject ~= s/:/: /

Quoted 13 lines · Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/tty/serial/imx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/imx.c +0 -0
index dfeff39..64f57c6 100644

drivers/tty/serial/imx.c static int serial_imx_probe(struct platform_device *pdev) · line 2118

Quoted 7 lines
drivers/tty/serial/imx.c +1 -3
@@ -2115,9 +2115,7 @@ static int serial_imx_probe(struct platform_device *pdev)
 	sport->port.rs485.flags =
 		SER_RS485_RTS_ON_SEND | SER_RS485_RX_DURING_TX;
 	sport->port.flags = UPF_BOOT_AUTOCONF;
-	init_timer(&sport->timer);
-	sport->timer.function = imx_timeout;
-	sport->timer.data     = (unsigned long)sport;
+	setup_timer(&sport->timer, imx_timeout, (unsigned long)sport);

Thanks
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |