public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* [PATCH 51/69] TTY: 68328serial, remove serial_state and friends
       [not found] <1333367693-3244-1-git-send-email-jslaby@suse.cz>
@ 2012-04-02 11:54 ` Jiri Slaby
  2012-04-02 11:54 ` [PATCH 52/69] TTY: 68328serial, remove unused stuff from m68k_serial Jiri Slaby
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: Jiri Slaby @ 2012-04-02 11:54 UTC (permalink / raw)
  To: gregkh; +Cc: alan, linux-kernel, jirislaby, Geert Uytterhoeven, linux-m68k

serial_state in 68328serial.h is a duplicated structure. One is
defined in linux/serial.h. So let us use that instead. And since the
serial flags are identical, use ones from there too.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 drivers/tty/serial/68328serial.c |   55 +++++++++++----------------
 drivers/tty/serial/68328serial.h |   76 --------------------------------------
 2 files changed, 22 insertions(+), 109 deletions(-)

diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index 5ce7825..bf5f811 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -17,6 +17,7 @@
 #include <asm/dbg.h>
 #include <linux/module.h>
 #include <linux/errno.h>
+#include <linux/serial.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/timer.h>
@@ -79,18 +80,6 @@ struct m68k_serial *m68k_consinfo = 0;
 
 struct tty_driver *serial_driver;
 
-/* number of characters left in xmit buffer before we ask for more */
-#define WAKEUP_CHARS 256
-
-/* Debugging... DEBUG_INTR is bad to use when one of the zs
- * lines is your console ;(
- */
-#undef SERIAL_DEBUG_INTR
-#undef SERIAL_DEBUG_OPEN
-#undef SERIAL_DEBUG_FLOW
-
-#define RS_ISR_PASS_LIMIT 256
-
 static void change_speed(struct m68k_serial *info);
 
 /*
@@ -363,7 +352,7 @@ static int startup(struct m68k_serial * info)
 	m68328_uart *uart = &uart_addr[info->line];
 	unsigned long flags;
 	
-	if (info->flags & S_INITIALIZED)
+	if (info->flags & ASYNC_INITIALIZED)
 		return 0;
 
 	if (!info->xmit_buf) {
@@ -404,7 +393,7 @@ static int startup(struct m68k_serial * info)
 
 	change_speed(info);
 
-	info->flags |= S_INITIALIZED;
+	info->flags |= ASYNC_INITIALIZED;
 	local_irq_restore(flags);
 	return 0;
 }
@@ -419,7 +408,7 @@ static void shutdown(struct m68k_serial * info)
 	unsigned long	flags;
 
 	uart->ustcnt = 0; /* All off! */
-	if (!(info->flags & S_INITIALIZED))
+	if (!(info->flags & ASYNC_INITIALIZED))
 		return;
 
 	local_irq_save(flags);
@@ -432,7 +421,7 @@ static void shutdown(struct m68k_serial * info)
 	if (info->tty)
 		set_bit(TTY_IO_ERROR, &info->tty->flags);
 	
-	info->flags &= ~S_INITIALIZED;
+	info->flags &= ~ASYNC_INITIALIZED;
 	local_irq_restore(flags);
 }
 
@@ -835,11 +824,11 @@ static int set_serial_info(struct m68k_serial * info,
 		if ((new_serial.baud_base != info->baud_base) ||
 		    (new_serial.type != info->type) ||
 		    (new_serial.close_delay != info->close_delay) ||
-		    ((new_serial.flags & ~S_USR_MASK) !=
-		     (info->flags & ~S_USR_MASK)))
+		    ((new_serial.flags & ~ASYNC_USR_MASK) !=
+		     (info->flags & ~ASYNC_USR_MASK)))
 			return -EPERM;
-		info->flags = ((info->flags & ~S_USR_MASK) |
-			       (new_serial.flags & S_USR_MASK));
+		info->flags = ((info->flags & ~ASYNC_USR_MASK) |
+			       (new_serial.flags & ASYNC_USR_MASK));
 		info->custom_divisor = new_serial.custom_divisor;
 		goto check_and_exit;
 	}
@@ -853,8 +842,8 @@ static int set_serial_info(struct m68k_serial * info,
 	 */
 
 	info->baud_base = new_serial.baud_base;
-	info->flags = ((info->flags & ~S_FLAGS) |
-			(new_serial.flags & S_FLAGS));
+	info->flags = ((info->flags & ~ASYNC_FLAGS) |
+			(new_serial.flags & ASYNC_FLAGS));
 	info->type = new_serial.type;
 	info->close_delay = new_serial.close_delay;
 	info->closing_wait = new_serial.closing_wait;
@@ -1022,13 +1011,13 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 		local_irq_restore(flags);
 		return;
 	}
-	info->flags |= S_CLOSING;
+	info->flags |= ASYNC_CLOSING;
 	/*
 	 * Now we wait for the transmit buffer to clear; and we notify 
 	 * the line discipline to only process XON/XOFF characters.
 	 */
 	tty->closing = 1;
-	if (info->closing_wait != S_CLOSING_WAIT_NONE)
+	if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE)
 		tty_wait_until_sent(tty, info->closing_wait);
 	/*
 	 * At this point we stop accepting input.  To do this, we
@@ -1064,7 +1053,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 		}
 		wake_up_interruptible(&info->open_wait);
 	}
-	info->flags &= ~(S_NORMAL_ACTIVE|S_CLOSING);
+	info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
 	wake_up_interruptible(&info->close_wait);
 	local_irq_restore(flags);
 }
@@ -1083,7 +1072,7 @@ void rs_hangup(struct tty_struct *tty)
 	shutdown(info);
 	info->event = 0;
 	info->count = 0;
-	info->flags &= ~S_NORMAL_ACTIVE;
+	info->flags &= ~ASYNC_NORMAL_ACTIVE;
 	info->tty = NULL;
 	wake_up_interruptible(&info->open_wait);
 }
@@ -1104,10 +1093,10 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 	 * If the device is in the middle of being closed, then block
 	 * until it's done, and then try again.
 	 */
-	if (info->flags & S_CLOSING) {
+	if (info->flags & ASYNC_CLOSING) {
 		interruptible_sleep_on(&info->close_wait);
 #ifdef SERIAL_DO_RESTART
-		if (info->flags & S_HUP_NOTIFY)
+		if (info->flags & ASYNC_HUP_NOTIFY)
 			return -EAGAIN;
 		else
 			return -ERESTARTSYS;
@@ -1122,7 +1111,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 	 */
 	if ((filp->f_flags & O_NONBLOCK) ||
 	    (tty->flags & (1 << TTY_IO_ERROR))) {
-		info->flags |= S_NORMAL_ACTIVE;
+		info->flags |= ASYNC_NORMAL_ACTIVE;
 		return 0;
 	}
 
@@ -1147,9 +1136,9 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 		local_irq_enable();
 		current->state = TASK_INTERRUPTIBLE;
 		if (tty_hung_up_p(filp) ||
-		    !(info->flags & S_INITIALIZED)) {
+		    !(info->flags & ASYNC_INITIALIZED)) {
 #ifdef SERIAL_DO_RESTART
-			if (info->flags & S_HUP_NOTIFY)
+			if (info->flags & ASYNC_HUP_NOTIFY)
 				retval = -EAGAIN;
 			else
 				retval = -ERESTARTSYS;	
@@ -1158,7 +1147,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 #endif
 			break;
 		}
-		if (!(info->flags & S_CLOSING) && do_clocal)
+		if (!(info->flags & ASYNC_CLOSING) && do_clocal)
 			break;
                 if (signal_pending(current)) {
 			retval = -ERESTARTSYS;
@@ -1176,7 +1165,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 
 	if (retval)
 		return retval;
-	info->flags |= S_NORMAL_ACTIVE;
+	info->flags |= ASYNC_NORMAL_ACTIVE;
 	return 0;
 }	
 
diff --git a/drivers/tty/serial/68328serial.h b/drivers/tty/serial/68328serial.h
index 3d2faab..a804ea5 100644
--- a/drivers/tty/serial/68328serial.h
+++ b/drivers/tty/serial/68328serial.h
@@ -11,69 +11,6 @@
 #ifndef _MC683XX_SERIAL_H
 #define _MC683XX_SERIAL_H
 
-
-struct serial_struct {
-	int	type;
-	int	line;
-	int	port;
-	int	irq;
-	int	flags;
-	int	xmit_fifo_size;
-	int	custom_divisor;
-	int	baud_base;
-	unsigned short	close_delay;
-	char	reserved_char[2];
-	int	hub6;  /* FIXME: We don't have AT&T Hub6 boards! */
-	unsigned short	closing_wait; /* time to wait before closing */
-	unsigned short	closing_wait2; /* no longer used... */
-	int	reserved[4];
-};
-
-/*
- * For the close wait times, 0 means wait forever for serial port to
- * flush its output.  65535 means don't wait at all.
- */
-#define S_CLOSING_WAIT_INF	0
-#define S_CLOSING_WAIT_NONE	65535
-
-/*
- * Definitions for S_struct (and serial_struct) flags field
- */
-#define S_HUP_NOTIFY 0x0001 /* Notify getty on hangups and closes 
-				   on the callout port */
-#define S_FOURPORT  0x0002	/* Set OU1, OUT2 per AST Fourport settings */
-#define S_SAK	0x0004	/* Secure Attention Key (Orange book) */
-#define S_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */
-
-#define S_SPD_MASK	0x0030
-#define S_SPD_HI	0x0010	/* Use 56000 instead of 38400 bps */
-
-#define S_SPD_VHI	0x0020  /* Use 115200 instead of 38400 bps */
-#define S_SPD_CUST	0x0030  /* Use user-specified divisor */
-
-#define S_SKIP_TEST	0x0040 /* Skip UART test during autoconfiguration */
-#define S_AUTO_IRQ  0x0080 /* Do automatic IRQ during autoconfiguration */
-#define S_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */
-#define S_PGRP_LOCKOUT    0x0200 /* Lock out cua opens based on pgrp */
-#define S_CALLOUT_NOHUP   0x0400 /* Don't do hangups for cua device */
-
-#define S_FLAGS	0x0FFF	/* Possible legal S flags */
-#define S_USR_MASK 0x0430	/* Legal flags that non-privileged
-				 * users can set or reset */
-
-/* Internal flags used only by kernel/chr_drv/serial.c */
-#define S_INITIALIZED	0x80000000 /* Serial port was initialized */
-#define S_CALLOUT_ACTIVE	0x40000000 /* Call out device is active */
-#define S_NORMAL_ACTIVE	0x20000000 /* Normal device is active */
-#define S_BOOT_AUTOCONF	0x10000000 /* Autoconfigure port on bootup */
-#define S_CLOSING		0x08000000 /* Serial port is closing */
-#define S_CTS_FLOW		0x04000000 /* Do CTS flow control */
-#define S_CHECK_CD		0x02000000 /* i.e., CLOCAL */
-
-/* Software state per channel */
-
-#ifdef __KERNEL__
-
 /*
  * I believe this is the optimal setting that reduces the number of interrupts.
  * At high speeds the output might become a little "bursted" (use USTCNT_TXHE
@@ -162,25 +99,12 @@ struct m68k_serial {
 	wait_queue_head_t	close_wait;
 };
 
-
 #define SERIAL_MAGIC 0x5301
 
-/*
- * The size of the serial xmit buffer is 1 page, or 4096 bytes
- */
-#define SERIAL_XMIT_SIZE 4096
-
-/*
- * Events are used to schedule things to happen at timer-interrupt
- * time, instead of at rs interrupt time.
- */
-#define RS_EVENT_WRITE_WAKEUP	0
-
 /* 
  * Define the number of ports supported and their irqs.
  */
 #define NR_PORTS 1
 #define UART_IRQ_DEFNS {UART_IRQ_NUM}
 
-#endif /* __KERNEL__ */
 #endif /* !(_MC683XX_SERIAL_H) */
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 52/69] TTY: 68328serial, remove unused stuff from m68k_serial
       [not found] <1333367693-3244-1-git-send-email-jslaby@suse.cz>
  2012-04-02 11:54 ` [PATCH 51/69] TTY: 68328serial, remove serial_state and friends Jiri Slaby
@ 2012-04-02 11:54 ` Jiri Slaby
  2012-04-02 11:54 ` [PATCH 53/69] TTY: 68328serial, remove garbage Jiri Slaby
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: Jiri Slaby @ 2012-04-02 11:54 UTC (permalink / raw)
  To: gregkh; +Cc: alan, linux-kernel, jirislaby, Geert Uytterhoeven, linux-m68k

Not everything from struct m68k_serial is really used. So remove
unused or only-set members of that structure. Next step is to move it
to 68328serial.c and remove 68328serial.h completely.

This change also takes status_handle and batten_down_hatches away
since they use break_abort but do nothing.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 drivers/tty/serial/68328serial.c |   36 ++++--------------------------------
 drivers/tty/serial/68328serial.h |   16 ----------------
 2 files changed, 4 insertions(+), 48 deletions(-)

diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index bf5f811..c1cd214 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -213,25 +213,6 @@ static void rs_start(struct tty_struct *tty)
 	local_irq_restore(flags);
 }
 
-/* Drop into either the boot monitor or kadb upon receiving a break
- * from keyboard/console input.
- */
-static void batten_down_hatches(void)
-{
-	/* Drop into the debugger */
-}
-
-static void status_handle(struct m68k_serial *info, unsigned short status)
-{
-	/* If this is console input and this is a
-	 * 'break asserted' status change interrupt
-	 * see if we can drop into the debugger
-	 */
-	if((status & URX_BREAK) && info->break_abort)
-		batten_down_hatches();
-	return;
-}
-
 static void receive_chars(struct m68k_serial *info, unsigned short rx)
 {
 	struct tty_struct *tty = info->tty;
@@ -248,7 +229,6 @@ static void receive_chars(struct m68k_serial *info, unsigned short rx)
 	
 		if(info->is_cons) {
 			if(URX_BREAK & rx) { /* whee, break received */
-				status_handle(info, rx);
 				return;
 #ifdef CONFIG_MAGIC_SYSRQ
 			} else if (ch == 0x10) { /* ^P */
@@ -269,16 +249,13 @@ static void receive_chars(struct m68k_serial *info, unsigned short rx)
 		
 		flag = TTY_NORMAL;
 
-		if(rx & URX_PARITY_ERROR) {
+		if (rx & URX_PARITY_ERROR)
 			flag = TTY_PARITY;
-			status_handle(info, rx);
-		} else if(rx & URX_OVRUN) {
+		else if (rx & URX_OVRUN)
 			flag = TTY_OVERRUN;
-			status_handle(info, rx);
-		} else if(rx & URX_FRAME_ERROR) {
+		else if (rx & URX_FRAME_ERROR)
 			flag = TTY_FRAME;
-			status_handle(info, rx);
-		}
+
 		tty_insert_flip_char(tty, ch, flag);
 #ifndef CONFIG_XCOPILOT_BUGS
 	} while((rx = uart->urx.w) & URX_DATA_READY);
@@ -369,7 +346,6 @@ static int startup(struct m68k_serial * info)
 	 */
 
 	uart->ustcnt = USTCNT_UEN;
-	info->xmit_fifo_size = 1;
 	uart->ustcnt = USTCNT_UEN | USTCNT_RXEN | USTCNT_TXEN;
 	(void)uart->urx.w;
 
@@ -499,7 +475,6 @@ static void change_speed(struct m68k_serial *info)
                 i = (i & ~CBAUDEX) + B38400;
         }
 
-	info->baud = baud_table[i];
 	uart->ubaud = PUT_FIELD(UBAUD_DIVIDE,    hw_baud_table[i].divisor) | 
 		PUT_FIELD(UBAUD_PRESCALER, hw_baud_table[i].prescale);
 
@@ -1034,7 +1009,6 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 		
 	tty_ldisc_flush(tty);
 	tty->closing = 0;
-	info->event = 0;
 	info->tty = NULL;
 #warning "This is not and has never been valid so fix it"	
 #if 0
@@ -1070,7 +1044,6 @@ void rs_hangup(struct tty_struct *tty)
 	
 	rs_flush_buffer(tty);
 	shutdown(info);
-	info->event = 0;
 	info->count = 0;
 	info->flags &= ~ASYNC_NORMAL_ACTIVE;
 	info->tty = NULL;
@@ -1270,7 +1243,6 @@ rs68328_init(void)
 	    info->close_delay = 50;
 	    info->closing_wait = 3000;
 	    info->x_char = 0;
-	    info->event = 0;
 	    info->count = 0;
 	    info->blocked_open = 0;
 	    init_waitqueue_head(&info->open_wait);
diff --git a/drivers/tty/serial/68328serial.h b/drivers/tty/serial/68328serial.h
index a804ea5..971ead5 100644
--- a/drivers/tty/serial/68328serial.h
+++ b/drivers/tty/serial/68328serial.h
@@ -60,16 +60,7 @@
  */
 
 struct m68k_serial {
-	char soft_carrier;  /* Use soft carrier on this channel */
-	char break_abort;   /* Is serial console in, so process brk/abrt */
 	char is_cons;       /* Is this our console. */
-
-	/* We need to know the current clock divisor
-	 * to read the bps rate the chip has currently
-	 * loaded.
-	 */
-	unsigned char clk_divisor;  /* May be 1, 16, 32, or 64 */
-	int baud;
 	int			magic;
 	int			baud_base;
 	int			port;
@@ -77,17 +68,10 @@ struct m68k_serial {
 	int			flags; 		/* defined in tty.h */
 	int			type; 		/* UART type */
 	struct tty_struct 	*tty;
-	int			read_status_mask;
-	int			ignore_status_mask;
-	int			timeout;
-	int			xmit_fifo_size;
 	int			custom_divisor;
 	int			x_char;	/* xon/xoff character */
 	int			close_delay;
 	unsigned short		closing_wait;
-	unsigned short		closing_wait2;
-	unsigned long		event;
-	unsigned long		last_active;
 	int			line;
 	int			count;	    /* # of fd on device */
 	int			blocked_open; /* # of blocked opens */
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 53/69] TTY: 68328serial, remove garbage
       [not found] <1333367693-3244-1-git-send-email-jslaby@suse.cz>
  2012-04-02 11:54 ` [PATCH 51/69] TTY: 68328serial, remove serial_state and friends Jiri Slaby
  2012-04-02 11:54 ` [PATCH 52/69] TTY: 68328serial, remove unused stuff from m68k_serial Jiri Slaby
@ 2012-04-02 11:54 ` Jiri Slaby
  2012-04-02 11:54 ` [PATCH 54/69] TTY: 68328serial, use ulong flags for interrupts status Jiri Slaby
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: Jiri Slaby @ 2012-04-02 11:54 UTC (permalink / raw)
  To: gregkh; +Cc: alan, linux-kernel, jirislaby, Geert Uytterhoeven, linux-m68k

- empty functions
- unused global variables

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 drivers/tty/serial/68328serial.c |   19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index c1cd214..81ed91e 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -73,11 +73,6 @@ static unsigned int uart_irqs[NR_PORTS] = UART_IRQ_DEFNS;
 /* multiple ports are contiguous in memory */
 m68328_uart *uart_addr = (m68328_uart *)USTCNT_ADDR;
 
-struct tty_struct m68k_ttys;
-struct m68k_serial *m68k_consinfo = 0;
-
-#define M68K_CLOCK (16667000) /* FIXME: 16MHz is likely wrong */
-
 struct tty_driver *serial_driver;
 
 static void change_speed(struct m68k_serial *info);
@@ -132,17 +127,6 @@ static int baud_table[] = {
 	0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
 	9600, 19200, 38400, 57600, 115200, 0 };
 
-/* Sets or clears DTR/RTS on the requested line */
-static inline void m68k_rtsdtr(struct m68k_serial *ss, int set)
-{
-	if (set) {
-		/* set the RTS/CTS line */
-	} else {
-		/* clear it */
-	}
-	return;
-}
-
 /* Utility routines */
 static inline int get_baud(struct m68k_serial *ss)
 {
@@ -1104,9 +1088,6 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 	info->count--;
 	info->blocked_open++;
 	while (1) {
-		local_irq_disable();
-		m68k_rtsdtr(info, 1);
-		local_irq_enable();
 		current->state = TASK_INTERRUPTIBLE;
 		if (tty_hung_up_p(filp) ||
 		    !(info->flags & ASYNC_INITIALIZED)) {
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 54/69] TTY: 68328serial, use ulong flags for interrupts status
       [not found] <1333367693-3244-1-git-send-email-jslaby@suse.cz>
                   ` (2 preceding siblings ...)
  2012-04-02 11:54 ` [PATCH 53/69] TTY: 68328serial, remove garbage Jiri Slaby
@ 2012-04-02 11:54 ` Jiri Slaby
  2012-04-02 11:54 ` [PATCH 55/69] TTY: 68328serial, remove 68328serial.h Jiri Slaby
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: Jiri Slaby @ 2012-04-02 11:54 UTC (permalink / raw)
  To: gregkh; +Cc: alan, linux-kernel, jirislaby, Geert Uytterhoeven, linux-m68k

flags passed to local_irq_save/restore should be ulong. Switch tehem
to that. Otherwise we get compilation warnings:
.../68328serial.c:248:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
.../68328serial.c:257:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 drivers/tty/serial/68328serial.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index 81ed91e..f0d5039 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -162,7 +162,8 @@ static void rs_stop(struct tty_struct *tty)
 
 static int rs_put_char(char ch)
 {
-        int flags, loops = 0;
+	unsigned long flags;
+	int loops = 0;
 
         local_irq_save(flags);
 
@@ -1182,7 +1183,8 @@ static const struct tty_operations rs_ops = {
 static int __init
 rs68328_init(void)
 {
-	int flags, i;
+	unsigned long flags;
+	int i;
 	struct m68k_serial *info;
 
 	serial_driver = alloc_tty_driver(NR_PORTS);
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 55/69] TTY: 68328serial, remove 68328serial.h
       [not found] <1333367693-3244-1-git-send-email-jslaby@suse.cz>
                   ` (3 preceding siblings ...)
  2012-04-02 11:54 ` [PATCH 54/69] TTY: 68328serial, use ulong flags for interrupts status Jiri Slaby
@ 2012-04-02 11:54 ` Jiri Slaby
  2012-04-02 11:54 ` [PATCH 56/69] TTY: 68328serial, add tty_port Jiri Slaby
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: Jiri Slaby @ 2012-04-02 11:54 UTC (permalink / raw)
  To: gregkh; +Cc: alan, linux-kernel, jirislaby, Geert Uytterhoeven, linux-m68k

All the needed stuff is moved to 68328serial.c now.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 drivers/tty/serial/68328serial.c |   79 ++++++++++++++++++++++++++++++--
 drivers/tty/serial/68328serial.h |   94 --------------------------------------
 2 files changed, 76 insertions(+), 97 deletions(-)
 delete mode 100644 drivers/tty/serial/68328serial.h

diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index f0d5039..116d932 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -57,8 +57,6 @@
 #endif /* CONFIG_M68VZ328 */
 #endif /* CONFIG_M68EZ328 */
 
-#include "68328serial.h"
-
 /* Turn off usage of real serial interrupt code, to "support" Copilot */
 #ifdef CONFIG_XCOPILOT_BUGS
 #undef USE_INTS
@@ -66,9 +64,84 @@
 #define USE_INTS
 #endif
 
+/*
+ * I believe this is the optimal setting that reduces the number of interrupts.
+ * At high speeds the output might become a little "bursted" (use USTCNT_TXHE
+ * if that bothers you), but in most cases it will not, since we try to
+ * transmit characters every time rs_interrupt is called. Thus, quite often
+ * you'll see that a receive interrupt occures before the transmit one.
+ *                                  -- Vladimir Gurevich
+ */
+#define USTCNT_TX_INTR_MASK (USTCNT_TXEE)
+
+/*
+ * 68328 and 68EZ328 UARTS are a little bit different. EZ328 has special
+ * "Old data interrupt" which occures whenever the data stay in the FIFO
+ * longer than 30 bits time. This allows us to use FIFO without compromising
+ * latency. '328 does not have this feature and without the real  328-based
+ * board I would assume that RXRE is the safest setting.
+ *
+ * For EZ328 I use RXHE (Half empty) interrupt to reduce the number of
+ * interrupts. RXFE (receive queue full) causes the system to lose data
+ * at least at 115200 baud
+ *
+ * If your board is busy doing other stuff, you might consider to use
+ * RXRE (data ready intrrupt) instead.
+ *
+ * The other option is to make these INTR masks run-time configurable, so
+ * that people can dynamically adapt them according to the current usage.
+ *                                  -- Vladimir Gurevich
+ */
+
+/* (es) */
+#if defined(CONFIG_M68EZ328) || defined(CONFIG_M68VZ328)
+#define USTCNT_RX_INTR_MASK (USTCNT_RXHE | USTCNT_ODEN)
+#elif defined(CONFIG_M68328)
+#define USTCNT_RX_INTR_MASK (USTCNT_RXRE)
+#else
+#error Please, define the Rx interrupt events for your CPU
+#endif
+/* (/es) */
+
+/*
+ * This is our internal structure for each serial port's state.
+ *
+ * For definitions of the flags field, see serial.h
+ */
+struct m68k_serial {
+	char			is_cons;	/* Is this our console. */
+	int			magic;
+	int			baud_base;
+	int			port;
+	int			irq;
+	int			flags;		/* defined in tty.h */
+	int			type;		/* UART type */
+	struct tty_struct	*tty;
+	int			custom_divisor;
+	int			x_char;		/* xon/xoff character */
+	int			close_delay;
+	unsigned short		closing_wait;
+	int			line;
+	int			count;		/* # of fd on device */
+	int			blocked_open;	/* # of blocked opens */
+	unsigned char		*xmit_buf;
+	int			xmit_head;
+	int			xmit_tail;
+	int			xmit_cnt;
+	wait_queue_head_t	open_wait;
+	wait_queue_head_t	close_wait;
+};
+
+#define SERIAL_MAGIC 0x5301
+
+/*
+ * Define the number of ports supported and their irqs.
+ */
+#define NR_PORTS 1
+
 static struct m68k_serial m68k_soft[NR_PORTS];
 
-static unsigned int uart_irqs[NR_PORTS] = UART_IRQ_DEFNS;
+static unsigned int uart_irqs[NR_PORTS] = { UART_IRQ_NUM };
 
 /* multiple ports are contiguous in memory */
 m68328_uart *uart_addr = (m68328_uart *)USTCNT_ADDR;
diff --git a/drivers/tty/serial/68328serial.h b/drivers/tty/serial/68328serial.h
deleted file mode 100644
index 971ead5..0000000
--- a/drivers/tty/serial/68328serial.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* 68328serial.h: Definitions for the mc68328 serial driver.
- *
- * Copyright (C) 1995       David S. Miller    <davem@caip.rutgers.edu>
- * Copyright (C) 1998       Kenneth Albanowski <kjahds@kjahds.com>
- * Copyright (C) 1998, 1999 D. Jeff Dionne     <jeff@uclinux.org>
- * Copyright (C) 1999       Vladimir Gurevich  <vgurevic@cisco.com>
- *
- * VZ Support/Fixes             Evan Stawnyczy <e@lineo.ca>
- */
-
-#ifndef _MC683XX_SERIAL_H
-#define _MC683XX_SERIAL_H
-
-/*
- * I believe this is the optimal setting that reduces the number of interrupts.
- * At high speeds the output might become a little "bursted" (use USTCNT_TXHE
- * if that bothers you), but in most cases it will not, since we try to 
- * transmit characters every time rs_interrupt is called. Thus, quite often
- * you'll see that a receive interrupt occures before the transmit one.
- *                                  -- Vladimir Gurevich
- */
-#define USTCNT_TX_INTR_MASK (USTCNT_TXEE)
-
-/*
- * 68328 and 68EZ328 UARTS are a little bit different. EZ328 has special
- * "Old data interrupt" which occures whenever the data stay in the FIFO
- * longer than 30 bits time. This allows us to use FIFO without compromising
- * latency. '328 does not have this feature and without the real  328-based
- * board I would assume that RXRE is the safest setting.
- *
- * For EZ328 I use RXHE (Half empty) interrupt to reduce the number of
- * interrupts. RXFE (receive queue full) causes the system to lose data
- * at least at 115200 baud
- *
- * If your board is busy doing other stuff, you might consider to use
- * RXRE (data ready intrrupt) instead.
- *
- * The other option is to make these INTR masks run-time configurable, so
- * that people can dynamically adapt them according to the current usage.
- *                                  -- Vladimir Gurevich
- */
-
-/* (es) */
-#if defined(CONFIG_M68EZ328) || defined(CONFIG_M68VZ328)
-#define USTCNT_RX_INTR_MASK (USTCNT_RXHE | USTCNT_ODEN)
-#elif defined(CONFIG_M68328)
-#define USTCNT_RX_INTR_MASK (USTCNT_RXRE)
-#else
-#error Please, define the Rx interrupt events for your CPU
-#endif
-/* (/es) */
-
-/*
- * This is our internal structure for each serial port's state.
- * 
- * Many fields are paralleled by the structure used by the serial_struct
- * structure.
- *
- * For definitions of the flags field, see tty.h
- */
-
-struct m68k_serial {
-	char is_cons;       /* Is this our console. */
-	int			magic;
-	int			baud_base;
-	int			port;
-	int			irq;
-	int			flags; 		/* defined in tty.h */
-	int			type; 		/* UART type */
-	struct tty_struct 	*tty;
-	int			custom_divisor;
-	int			x_char;	/* xon/xoff character */
-	int			close_delay;
-	unsigned short		closing_wait;
-	int			line;
-	int			count;	    /* # of fd on device */
-	int			blocked_open; /* # of blocked opens */
-	unsigned char 		*xmit_buf;
-	int			xmit_head;
-	int			xmit_tail;
-	int			xmit_cnt;
-	wait_queue_head_t	open_wait;
-	wait_queue_head_t	close_wait;
-};
-
-#define SERIAL_MAGIC 0x5301
-
-/* 
- * Define the number of ports supported and their irqs.
- */
-#define NR_PORTS 1
-#define UART_IRQ_DEFNS {UART_IRQ_NUM}
-
-#endif /* !(_MC683XX_SERIAL_H) */
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 56/69] TTY: 68328serial, add tty_port
       [not found] <1333367693-3244-1-git-send-email-jslaby@suse.cz>
                   ` (4 preceding siblings ...)
  2012-04-02 11:54 ` [PATCH 55/69] TTY: 68328serial, remove 68328serial.h Jiri Slaby
@ 2012-04-02 11:54 ` Jiri Slaby
  2012-04-02 11:54 ` [PATCH 57/69] TTY: 68328serial, use open/close_wait from tty_port Jiri Slaby
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: Jiri Slaby @ 2012-04-02 11:54 UTC (permalink / raw)
  To: gregkh; +Cc: alan, linux-kernel, jirislaby, Geert Uytterhoeven, linux-m68k

And use count and blocked_count from that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 drivers/tty/serial/68328serial.c |   40 +++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index 116d932..848662c 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -109,6 +109,7 @@
  * For definitions of the flags field, see serial.h
  */
 struct m68k_serial {
+	struct tty_port		tport;
 	char			is_cons;	/* Is this our console. */
 	int			magic;
 	int			baud_base;
@@ -122,8 +123,6 @@ struct m68k_serial {
 	int			close_delay;
 	unsigned short		closing_wait;
 	int			line;
-	int			count;		/* # of fd on device */
-	int			blocked_open;	/* # of blocked opens */
 	unsigned char		*xmit_buf;
 	int			xmit_head;
 	int			xmit_tail;
@@ -866,7 +865,7 @@ static int set_serial_info(struct m68k_serial * info,
 		goto check_and_exit;
 	}
 
-	if (info->count > 1)
+	if (info->tport.count > 1)
 		return -EBUSY;
 
 	/*
@@ -1010,6 +1009,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
 static void rs_close(struct tty_struct *tty, struct file * filp)
 {
 	struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
+	struct tty_port *port = &info->tport;
 	m68328_uart *uart = &uart_addr[info->line];
 	unsigned long flags;
 
@@ -1023,7 +1023,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 		return;
 	}
 	
-	if ((tty->count == 1) && (info->count != 1)) {
+	if ((tty->count == 1) && (port->count != 1)) {
 		/*
 		 * Uh, oh.  tty->count is 1, which means that the tty
 		 * structure will be freed.  Info->count should always
@@ -1032,15 +1032,15 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 		 * serial port won't be shutdown.
 		 */
 		printk("rs_close: bad serial port count; tty->count is 1, "
-		       "info->count is %d\n", info->count);
-		info->count = 1;
+		       "port->count is %d\n", port->count);
+		port->count = 1;
 	}
-	if (--info->count < 0) {
+	if (--port->count < 0) {
 		printk("rs_close: bad serial port count for ttyS%d: %d\n",
-		       info->line, info->count);
-		info->count = 0;
+		       info->line, port->count);
+		port->count = 0;
 	}
-	if (info->count) {
+	if (port->count) {
 		local_irq_restore(flags);
 		return;
 	}
@@ -1079,7 +1079,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 			(tty->ldisc.open)(tty);
 	}
 #endif	
-	if (info->blocked_open) {
+	if (port->blocked_open) {
 		if (info->close_delay) {
 			msleep_interruptible(jiffies_to_msecs(info->close_delay));
 		}
@@ -1102,7 +1102,7 @@ void rs_hangup(struct tty_struct *tty)
 	
 	rs_flush_buffer(tty);
 	shutdown(info);
-	info->count = 0;
+	info->tport.count = 0;
 	info->flags &= ~ASYNC_NORMAL_ACTIVE;
 	info->tty = NULL;
 	wake_up_interruptible(&info->open_wait);
@@ -1116,6 +1116,7 @@ void rs_hangup(struct tty_struct *tty)
 static int block_til_ready(struct tty_struct *tty, struct file * filp,
 			   struct m68k_serial *info)
 {
+	struct tty_port *port = &info->tport;
 	DECLARE_WAITQUEUE(wait, current);
 	int		retval;
 	int		do_clocal = 0;
@@ -1152,15 +1153,15 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 	/*
 	 * Block waiting for the carrier detect and the line to become
 	 * free (i.e., not in use by the callout).  While we are in
-	 * this loop, info->count is dropped by one, so that
+	 * this loop, port->count is dropped by one, so that
 	 * rs_close() knows when to free things.  We restore it upon
 	 * exit, either normal or abnormal.
 	 */
 	retval = 0;
 	add_wait_queue(&info->open_wait, &wait);
 
-	info->count--;
-	info->blocked_open++;
+	port->count--;
+	port->blocked_open++;
 	while (1) {
 		current->state = TASK_INTERRUPTIBLE;
 		if (tty_hung_up_p(filp) ||
@@ -1188,8 +1189,8 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 	current->state = TASK_RUNNING;
 	remove_wait_queue(&info->open_wait, &wait);
 	if (!tty_hung_up_p(filp))
-		info->count++;
-	info->blocked_open--;
+		port->count++;
+	port->blocked_open--;
 
 	if (retval)
 		return retval;
@@ -1213,7 +1214,7 @@ int rs_open(struct tty_struct *tty, struct file * filp)
 	if (serial_paranoia_check(info, tty->name, "rs_open"))
 		return -ENODEV;
 
-	info->count++;
+	info->tport.count++;
 	tty->driver_data = info;
 	info->tty = tty;
 
@@ -1291,6 +1292,7 @@ rs68328_init(void)
 	for(i=0;i<NR_PORTS;i++) {
 
 	    info = &m68k_soft[i];
+	    tty_port_init(&info->tport);
 	    info->magic = SERIAL_MAGIC;
 	    info->port = (int) &uart_addr[i];
 	    info->tty = NULL;
@@ -1299,8 +1301,6 @@ rs68328_init(void)
 	    info->close_delay = 50;
 	    info->closing_wait = 3000;
 	    info->x_char = 0;
-	    info->count = 0;
-	    info->blocked_open = 0;
 	    init_waitqueue_head(&info->open_wait);
 	    init_waitqueue_head(&info->close_wait);
 	    info->line = i;
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 57/69] TTY: 68328serial, use open/close_wait from tty_port
       [not found] <1333367693-3244-1-git-send-email-jslaby@suse.cz>
                   ` (5 preceding siblings ...)
  2012-04-02 11:54 ` [PATCH 56/69] TTY: 68328serial, add tty_port Jiri Slaby
@ 2012-04-02 11:54 ` Jiri Slaby
  2012-04-02 11:54 ` [PATCH 58/69] TTY: 68328serial, use close_delay/closing_wait " Jiri Slaby
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: Jiri Slaby @ 2012-04-02 11:54 UTC (permalink / raw)
  To: gregkh; +Cc: alan, linux-kernel, jirislaby, Geert Uytterhoeven, linux-m68k

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 drivers/tty/serial/68328serial.c |   16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index 848662c..0c50f2e 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -127,8 +127,6 @@ struct m68k_serial {
 	int			xmit_head;
 	int			xmit_tail;
 	int			xmit_cnt;
-	wait_queue_head_t	open_wait;
-	wait_queue_head_t	close_wait;
 };
 
 #define SERIAL_MAGIC 0x5301
@@ -1083,10 +1081,10 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 		if (info->close_delay) {
 			msleep_interruptible(jiffies_to_msecs(info->close_delay));
 		}
-		wake_up_interruptible(&info->open_wait);
+		wake_up_interruptible(&port->open_wait);
 	}
 	info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
-	wake_up_interruptible(&info->close_wait);
+	wake_up_interruptible(&port->close_wait);
 	local_irq_restore(flags);
 }
 
@@ -1105,7 +1103,7 @@ void rs_hangup(struct tty_struct *tty)
 	info->tport.count = 0;
 	info->flags &= ~ASYNC_NORMAL_ACTIVE;
 	info->tty = NULL;
-	wake_up_interruptible(&info->open_wait);
+	wake_up_interruptible(&info->tport.open_wait);
 }
 
 /*
@@ -1126,7 +1124,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 	 * until it's done, and then try again.
 	 */
 	if (info->flags & ASYNC_CLOSING) {
-		interruptible_sleep_on(&info->close_wait);
+		interruptible_sleep_on(&port->close_wait);
 #ifdef SERIAL_DO_RESTART
 		if (info->flags & ASYNC_HUP_NOTIFY)
 			return -EAGAIN;
@@ -1158,7 +1156,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 	 * exit, either normal or abnormal.
 	 */
 	retval = 0;
-	add_wait_queue(&info->open_wait, &wait);
+	add_wait_queue(&port->open_wait, &wait);
 
 	port->count--;
 	port->blocked_open++;
@@ -1187,7 +1185,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 		tty_lock();
 	}
 	current->state = TASK_RUNNING;
-	remove_wait_queue(&info->open_wait, &wait);
+	remove_wait_queue(&port->open_wait, &wait);
 	if (!tty_hung_up_p(filp))
 		port->count++;
 	port->blocked_open--;
@@ -1301,8 +1299,6 @@ rs68328_init(void)
 	    info->close_delay = 50;
 	    info->closing_wait = 3000;
 	    info->x_char = 0;
-	    init_waitqueue_head(&info->open_wait);
-	    init_waitqueue_head(&info->close_wait);
 	    info->line = i;
 	    info->is_cons = 1; /* Means shortcuts work */
 	    
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 58/69] TTY: 68328serial, use close_delay/closing_wait from tty_port
       [not found] <1333367693-3244-1-git-send-email-jslaby@suse.cz>
                   ` (6 preceding siblings ...)
  2012-04-02 11:54 ` [PATCH 57/69] TTY: 68328serial, use open/close_wait from tty_port Jiri Slaby
@ 2012-04-02 11:54 ` Jiri Slaby
  2012-04-02 11:54 ` [PATCH 59/69] TTY: 68328serial, use flags " Jiri Slaby
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: Jiri Slaby @ 2012-04-02 11:54 UTC (permalink / raw)
  To: gregkh; +Cc: alan, linux-kernel, jirislaby, Geert Uytterhoeven, linux-m68k

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 drivers/tty/serial/68328serial.c |   26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index 0c50f2e..e9fd13e 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -120,8 +120,6 @@ struct m68k_serial {
 	struct tty_struct	*tty;
 	int			custom_divisor;
 	int			x_char;		/* xon/xoff character */
-	int			close_delay;
-	unsigned short		closing_wait;
 	int			line;
 	unsigned char		*xmit_buf;
 	int			xmit_head;
@@ -828,8 +826,8 @@ static int get_serial_info(struct m68k_serial * info,
 	tmp.irq = info->irq;
 	tmp.flags = info->flags;
 	tmp.baud_base = info->baud_base;
-	tmp.close_delay = info->close_delay;
-	tmp.closing_wait = info->closing_wait;
+	tmp.close_delay = info->tport.close_delay;
+	tmp.closing_wait = info->tport.closing_wait;
 	tmp.custom_divisor = info->custom_divisor;
 	if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
 		return -EFAULT;
@@ -840,6 +838,7 @@ static int get_serial_info(struct m68k_serial * info,
 static int set_serial_info(struct m68k_serial * info,
 			   struct serial_struct * new_info)
 {
+	struct tty_port *port = &info->tport;
 	struct serial_struct new_serial;
 	struct m68k_serial old_info;
 	int 			retval = 0;
@@ -853,7 +852,7 @@ static int set_serial_info(struct m68k_serial * info,
 	if (!capable(CAP_SYS_ADMIN)) {
 		if ((new_serial.baud_base != info->baud_base) ||
 		    (new_serial.type != info->type) ||
-		    (new_serial.close_delay != info->close_delay) ||
+		    (new_serial.close_delay != port->close_delay) ||
 		    ((new_serial.flags & ~ASYNC_USR_MASK) !=
 		     (info->flags & ~ASYNC_USR_MASK)))
 			return -EPERM;
@@ -863,7 +862,7 @@ static int set_serial_info(struct m68k_serial * info,
 		goto check_and_exit;
 	}
 
-	if (info->tport.count > 1)
+	if (port->count > 1)
 		return -EBUSY;
 
 	/*
@@ -875,8 +874,8 @@ static int set_serial_info(struct m68k_serial * info,
 	info->flags = ((info->flags & ~ASYNC_FLAGS) |
 			(new_serial.flags & ASYNC_FLAGS));
 	info->type = new_serial.type;
-	info->close_delay = new_serial.close_delay;
-	info->closing_wait = new_serial.closing_wait;
+	port->close_delay = new_serial.close_delay;
+	port->closing_wait = new_serial.closing_wait;
 
 check_and_exit:
 	retval = startup(info);
@@ -1048,8 +1047,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 	 * the line discipline to only process XON/XOFF characters.
 	 */
 	tty->closing = 1;
-	if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE)
-		tty_wait_until_sent(tty, info->closing_wait);
+	if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE)
+		tty_wait_until_sent(tty, port->closing_wait);
 	/*
 	 * At this point we stop accepting input.  To do this, we
 	 * disable the receive line status interrupts, and tell the
@@ -1078,9 +1077,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 	}
 #endif	
 	if (port->blocked_open) {
-		if (info->close_delay) {
-			msleep_interruptible(jiffies_to_msecs(info->close_delay));
-		}
+		if (port->close_delay)
+			msleep_interruptible(jiffies_to_msecs(port->close_delay));
 		wake_up_interruptible(&port->open_wait);
 	}
 	info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
@@ -1296,8 +1294,6 @@ rs68328_init(void)
 	    info->tty = NULL;
 	    info->irq = uart_irqs[i];
 	    info->custom_divisor = 16;
-	    info->close_delay = 50;
-	    info->closing_wait = 3000;
 	    info->x_char = 0;
 	    info->line = i;
 	    info->is_cons = 1; /* Means shortcuts work */
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 59/69] TTY: 68328serial, use flags from tty_port
       [not found] <1333367693-3244-1-git-send-email-jslaby@suse.cz>
                   ` (7 preceding siblings ...)
  2012-04-02 11:54 ` [PATCH 58/69] TTY: 68328serial, use close_delay/closing_wait " Jiri Slaby
@ 2012-04-02 11:54 ` Jiri Slaby
  2012-04-02 11:54 ` [PATCH 60/69] TTY: 68328serial, propagate tty Jiri Slaby
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: Jiri Slaby @ 2012-04-02 11:54 UTC (permalink / raw)
  To: gregkh; +Cc: alan, linux-kernel, jirislaby, Geert Uytterhoeven, linux-m68k

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 drivers/tty/serial/68328serial.c |   39 ++++++++++++++++++--------------------
 1 file changed, 18 insertions(+), 21 deletions(-)

diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index e9fd13e..e3a1c55 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -105,8 +105,6 @@
 
 /*
  * This is our internal structure for each serial port's state.
- *
- * For definitions of the flags field, see serial.h
  */
 struct m68k_serial {
 	struct tty_port		tport;
@@ -115,7 +113,6 @@ struct m68k_serial {
 	int			baud_base;
 	int			port;
 	int			irq;
-	int			flags;		/* defined in tty.h */
 	int			type;		/* UART type */
 	struct tty_struct	*tty;
 	int			custom_divisor;
@@ -382,7 +379,7 @@ static int startup(struct m68k_serial * info)
 	m68328_uart *uart = &uart_addr[info->line];
 	unsigned long flags;
 	
-	if (info->flags & ASYNC_INITIALIZED)
+	if (info->tport.flags & ASYNC_INITIALIZED)
 		return 0;
 
 	if (!info->xmit_buf) {
@@ -422,7 +419,7 @@ static int startup(struct m68k_serial * info)
 
 	change_speed(info);
 
-	info->flags |= ASYNC_INITIALIZED;
+	info->tport.flags |= ASYNC_INITIALIZED;
 	local_irq_restore(flags);
 	return 0;
 }
@@ -437,7 +434,7 @@ static void shutdown(struct m68k_serial * info)
 	unsigned long	flags;
 
 	uart->ustcnt = 0; /* All off! */
-	if (!(info->flags & ASYNC_INITIALIZED))
+	if (!(info->tport.flags & ASYNC_INITIALIZED))
 		return;
 
 	local_irq_save(flags);
@@ -450,7 +447,7 @@ static void shutdown(struct m68k_serial * info)
 	if (info->tty)
 		set_bit(TTY_IO_ERROR, &info->tty->flags);
 	
-	info->flags &= ~ASYNC_INITIALIZED;
+	info->tport.flags &= ~ASYNC_INITIALIZED;
 	local_irq_restore(flags);
 }
 
@@ -824,7 +821,7 @@ static int get_serial_info(struct m68k_serial * info,
 	tmp.line = info->line;
 	tmp.port = info->port;
 	tmp.irq = info->irq;
-	tmp.flags = info->flags;
+	tmp.flags = info->tport.flags;
 	tmp.baud_base = info->baud_base;
 	tmp.close_delay = info->tport.close_delay;
 	tmp.closing_wait = info->tport.closing_wait;
@@ -854,9 +851,9 @@ static int set_serial_info(struct m68k_serial * info,
 		    (new_serial.type != info->type) ||
 		    (new_serial.close_delay != port->close_delay) ||
 		    ((new_serial.flags & ~ASYNC_USR_MASK) !=
-		     (info->flags & ~ASYNC_USR_MASK)))
+		     (port->flags & ~ASYNC_USR_MASK)))
 			return -EPERM;
-		info->flags = ((info->flags & ~ASYNC_USR_MASK) |
+		port->flags = ((port->flags & ~ASYNC_USR_MASK) |
 			       (new_serial.flags & ASYNC_USR_MASK));
 		info->custom_divisor = new_serial.custom_divisor;
 		goto check_and_exit;
@@ -871,7 +868,7 @@ static int set_serial_info(struct m68k_serial * info,
 	 */
 
 	info->baud_base = new_serial.baud_base;
-	info->flags = ((info->flags & ~ASYNC_FLAGS) |
+	port->flags = ((port->flags & ~ASYNC_FLAGS) |
 			(new_serial.flags & ASYNC_FLAGS));
 	info->type = new_serial.type;
 	port->close_delay = new_serial.close_delay;
@@ -1041,7 +1038,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 		local_irq_restore(flags);
 		return;
 	}
-	info->flags |= ASYNC_CLOSING;
+	port->flags |= ASYNC_CLOSING;
 	/*
 	 * Now we wait for the transmit buffer to clear; and we notify 
 	 * the line discipline to only process XON/XOFF characters.
@@ -1081,7 +1078,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 			msleep_interruptible(jiffies_to_msecs(port->close_delay));
 		wake_up_interruptible(&port->open_wait);
 	}
-	info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
+	port->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
 	wake_up_interruptible(&port->close_wait);
 	local_irq_restore(flags);
 }
@@ -1099,7 +1096,7 @@ void rs_hangup(struct tty_struct *tty)
 	rs_flush_buffer(tty);
 	shutdown(info);
 	info->tport.count = 0;
-	info->flags &= ~ASYNC_NORMAL_ACTIVE;
+	info->tport.flags &= ~ASYNC_NORMAL_ACTIVE;
 	info->tty = NULL;
 	wake_up_interruptible(&info->tport.open_wait);
 }
@@ -1121,10 +1118,10 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 	 * If the device is in the middle of being closed, then block
 	 * until it's done, and then try again.
 	 */
-	if (info->flags & ASYNC_CLOSING) {
+	if (port->flags & ASYNC_CLOSING) {
 		interruptible_sleep_on(&port->close_wait);
 #ifdef SERIAL_DO_RESTART
-		if (info->flags & ASYNC_HUP_NOTIFY)
+		if (port->flags & ASYNC_HUP_NOTIFY)
 			return -EAGAIN;
 		else
 			return -ERESTARTSYS;
@@ -1139,7 +1136,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 	 */
 	if ((filp->f_flags & O_NONBLOCK) ||
 	    (tty->flags & (1 << TTY_IO_ERROR))) {
-		info->flags |= ASYNC_NORMAL_ACTIVE;
+		port->flags |= ASYNC_NORMAL_ACTIVE;
 		return 0;
 	}
 
@@ -1161,9 +1158,9 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 	while (1) {
 		current->state = TASK_INTERRUPTIBLE;
 		if (tty_hung_up_p(filp) ||
-		    !(info->flags & ASYNC_INITIALIZED)) {
+		    !(port->flags & ASYNC_INITIALIZED)) {
 #ifdef SERIAL_DO_RESTART
-			if (info->flags & ASYNC_HUP_NOTIFY)
+			if (port->flags & ASYNC_HUP_NOTIFY)
 				retval = -EAGAIN;
 			else
 				retval = -ERESTARTSYS;	
@@ -1172,7 +1169,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 #endif
 			break;
 		}
-		if (!(info->flags & ASYNC_CLOSING) && do_clocal)
+		if (!(port->flags & ASYNC_CLOSING) && do_clocal)
 			break;
                 if (signal_pending(current)) {
 			retval = -ERESTARTSYS;
@@ -1190,7 +1187,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
 
 	if (retval)
 		return retval;
-	info->flags |= ASYNC_NORMAL_ACTIVE;
+	port->flags |= ASYNC_NORMAL_ACTIVE;
 	return 0;
 }	
 
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 60/69] TTY: 68328serial, propagate tty
       [not found] <1333367693-3244-1-git-send-email-jslaby@suse.cz>
                   ` (8 preceding siblings ...)
  2012-04-02 11:54 ` [PATCH 59/69] TTY: 68328serial, use flags " Jiri Slaby
@ 2012-04-02 11:54 ` Jiri Slaby
  2012-04-02 11:54 ` [PATCH 61/69] TTY: 68328serial, use tty from tty_port Jiri Slaby
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: Jiri Slaby @ 2012-04-02 11:54 UTC (permalink / raw)
  To: gregkh; +Cc: alan, linux-kernel, jirislaby, Geert Uytterhoeven, linux-m68k

We need tty at some places, but info->tty might be NULL at those. Let
us propagate tty from callers where we know we have a valid tty. This
will make a switch to tty refcounting simpler.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 drivers/tty/serial/68328serial.c |   53 +++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 26 deletions(-)

diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index e3a1c55..fde573b 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -140,7 +140,7 @@ m68328_uart *uart_addr = (m68328_uart *)USTCNT_ADDR;
 
 struct tty_driver *serial_driver;
 
-static void change_speed(struct m68k_serial *info);
+static void change_speed(struct m68k_serial *info, struct tty_struct *tty);
 
 /*
  *	Setup for console. Argument comes from the boot command line.
@@ -263,9 +263,9 @@ static void rs_start(struct tty_struct *tty)
 	local_irq_restore(flags);
 }
 
-static void receive_chars(struct m68k_serial *info, unsigned short rx)
+static void receive_chars(struct m68k_serial *info, struct tty_struct *tty,
+		unsigned short rx)
 {
-	struct tty_struct *tty = info->tty;
 	m68328_uart *uart = &uart_addr[info->line];
 	unsigned char ch, flag;
 
@@ -317,7 +317,7 @@ clear_and_exit:
 	return;
 }
 
-static void transmit_chars(struct m68k_serial *info)
+static void transmit_chars(struct m68k_serial *info, struct tty_struct *tty)
 {
 	m68328_uart *uart = &uart_addr[info->line];
 
@@ -328,7 +328,7 @@ static void transmit_chars(struct m68k_serial *info)
 		goto clear_and_return;
 	}
 
-	if((info->xmit_cnt <= 0) || info->tty->stopped) {
+	if ((info->xmit_cnt <= 0) || !tty || tty->stopped) {
 		/* That's peculiar... TX ints off */
 		uart->ustcnt &= ~USTCNT_TX_INTR_MASK;
 		goto clear_and_return;
@@ -356,6 +356,7 @@ clear_and_return:
 irqreturn_t rs_interrupt(int irq, void *dev_id)
 {
 	struct m68k_serial *info = dev_id;
+	struct tty_struct *tty = info->tty;
 	m68328_uart *uart;
 	unsigned short rx;
 	unsigned short tx;
@@ -366,15 +367,17 @@ irqreturn_t rs_interrupt(int irq, void *dev_id)
 #ifdef USE_INTS
 	tx = uart->utx.w;
 
-	if (rx & URX_DATA_READY) receive_chars(info, rx);
-	if (tx & UTX_TX_AVAIL)   transmit_chars(info);
+	if (rx & URX_DATA_READY)
+		receive_chars(info, tty, rx);
+	if (tx & UTX_TX_AVAIL)
+		transmit_chars(info, tty);
 #else
-	receive_chars(info, rx);		
+	receive_chars(info, tty, rx);
 #endif
 	return IRQ_HANDLED;
 }
 
-static int startup(struct m68k_serial * info)
+static int startup(struct m68k_serial *info, struct tty_struct *tty)
 {
 	m68328_uart *uart = &uart_addr[info->line];
 	unsigned long flags;
@@ -409,15 +412,15 @@ static int startup(struct m68k_serial * info)
 	uart->ustcnt = USTCNT_UEN | USTCNT_RXEN | USTCNT_RX_INTR_MASK;
 #endif
 
-	if (info->tty)
-		clear_bit(TTY_IO_ERROR, &info->tty->flags);
+	if (tty)
+		clear_bit(TTY_IO_ERROR, &tty->flags);
 	info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
 
 	/*
 	 * and set the speed of the serial port
 	 */
 
-	change_speed(info);
+	change_speed(info, tty);
 
 	info->tport.flags |= ASYNC_INITIALIZED;
 	local_irq_restore(flags);
@@ -428,7 +431,7 @@ static int startup(struct m68k_serial * info)
  * This routine will shutdown a serial port; interrupts are disabled, and
  * DTR is dropped if the hangup on close termio flag is on.
  */
-static void shutdown(struct m68k_serial * info)
+static void shutdown(struct m68k_serial *info, struct tty_struct *tty)
 {
 	m68328_uart *uart = &uart_addr[info->line];
 	unsigned long	flags;
@@ -444,8 +447,8 @@ static void shutdown(struct m68k_serial * info)
 		info->xmit_buf = 0;
 	}
 
-	if (info->tty)
-		set_bit(TTY_IO_ERROR, &info->tty->flags);
+	if (tty)
+		set_bit(TTY_IO_ERROR, &tty->flags);
 	
 	info->tport.flags &= ~ASYNC_INITIALIZED;
 	local_irq_restore(flags);
@@ -503,7 +506,7 @@ struct {
  * This routine is called to set the UART divisor registers to match
  * the specified baud rate for a serial port.
  */
-static void change_speed(struct m68k_serial *info)
+static void change_speed(struct m68k_serial *info, struct tty_struct *tty)
 {
 	m68328_uart *uart = &uart_addr[info->line];
 	unsigned short port;
@@ -511,9 +514,7 @@ static void change_speed(struct m68k_serial *info)
 	unsigned cflag;
 	int	i;
 
-	if (!info->tty || !info->tty->termios)
-		return;
-	cflag = info->tty->termios->c_cflag;
+	cflag = tty->termios->c_cflag;
 	if (!(port = info->port))
 		return;
 
@@ -832,7 +833,7 @@ static int get_serial_info(struct m68k_serial * info,
 	return 0;
 }
 
-static int set_serial_info(struct m68k_serial * info,
+static int set_serial_info(struct m68k_serial *info, struct tty_struct *tty,
 			   struct serial_struct * new_info)
 {
 	struct tty_port *port = &info->tport;
@@ -875,7 +876,7 @@ static int set_serial_info(struct m68k_serial * info,
 	port->closing_wait = new_serial.closing_wait;
 
 check_and_exit:
-	retval = startup(info);
+	retval = startup(info, tty);
 	return retval;
 }
 
@@ -961,7 +962,7 @@ static int rs_ioctl(struct tty_struct *tty,
 			return get_serial_info(info,
 				       (struct serial_struct *) arg);
 		case TIOCSSERIAL:
-			return set_serial_info(info,
+			return set_serial_info(info, tty,
 					       (struct serial_struct *) arg);
 		case TIOCSERGETLSR: /* Get line status register */
 			return get_lsr_info(info, (unsigned int *) arg);
@@ -980,7 +981,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
 {
 	struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
 
-	change_speed(info);
+	change_speed(info, tty);
 
 	if ((old_termios->c_cflag & CRTSCTS) &&
 	    !(tty->termios->c_cflag & CRTSCTS)) {
@@ -1056,7 +1057,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 	uart->ustcnt &= ~USTCNT_RXEN;
 	uart->ustcnt &= ~(USTCNT_RXEN | USTCNT_RX_INTR_MASK);
 
-	shutdown(info);
+	shutdown(info, tty);
 	rs_flush_buffer(tty);
 		
 	tty_ldisc_flush(tty);
@@ -1094,7 +1095,7 @@ void rs_hangup(struct tty_struct *tty)
 		return;
 	
 	rs_flush_buffer(tty);
-	shutdown(info);
+	shutdown(info, tty);
 	info->tport.count = 0;
 	info->tport.flags &= ~ASYNC_NORMAL_ACTIVE;
 	info->tty = NULL;
@@ -1214,7 +1215,7 @@ int rs_open(struct tty_struct *tty, struct file * filp)
 	/*
 	 * Start up serial port
 	 */
-	retval = startup(info);
+	retval = startup(info, tty);
 	if (retval)
 		return retval;
 
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 61/69] TTY: 68328serial, use tty from tty_port
       [not found] <1333367693-3244-1-git-send-email-jslaby@suse.cz>
                   ` (9 preceding siblings ...)
  2012-04-02 11:54 ` [PATCH 60/69] TTY: 68328serial, propagate tty Jiri Slaby
@ 2012-04-02 11:54 ` Jiri Slaby
  2012-04-02 11:54 ` [PATCH 62/69] TTY: 68328serial, use tty_port_block_til_ready Jiri Slaby
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: Jiri Slaby @ 2012-04-02 11:54 UTC (permalink / raw)
  To: gregkh; +Cc: alan, linux-kernel, jirislaby, Geert Uytterhoeven, linux-m68k

And refcount that properly.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 drivers/tty/serial/68328serial.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index fde573b..77e10bb 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -114,7 +114,6 @@ struct m68k_serial {
 	int			port;
 	int			irq;
 	int			type;		/* UART type */
-	struct tty_struct	*tty;
 	int			custom_divisor;
 	int			x_char;		/* xon/xoff character */
 	int			line;
@@ -356,7 +355,7 @@ clear_and_return:
 irqreturn_t rs_interrupt(int irq, void *dev_id)
 {
 	struct m68k_serial *info = dev_id;
-	struct tty_struct *tty = info->tty;
+	struct tty_struct *tty = tty_port_tty_get(&info->tport);
 	m68328_uart *uart;
 	unsigned short rx;
 	unsigned short tx;
@@ -374,6 +373,8 @@ irqreturn_t rs_interrupt(int irq, void *dev_id)
 #else
 	receive_chars(info, tty, rx);
 #endif
+	tty_kref_put(tty);
+
 	return IRQ_HANDLED;
 }
 
@@ -1062,7 +1063,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 		
 	tty_ldisc_flush(tty);
 	tty->closing = 0;
-	info->tty = NULL;
+	tty_port_tty_set(&info->tport, NULL);
 #warning "This is not and has never been valid so fix it"	
 #if 0
 	if (tty->ldisc.num != ldiscs[N_TTY].num) {
@@ -1098,7 +1099,7 @@ void rs_hangup(struct tty_struct *tty)
 	shutdown(info, tty);
 	info->tport.count = 0;
 	info->tport.flags &= ~ASYNC_NORMAL_ACTIVE;
-	info->tty = NULL;
+	tty_port_tty_set(&info->tport, NULL);
 	wake_up_interruptible(&info->tport.open_wait);
 }
 
@@ -1210,7 +1211,7 @@ int rs_open(struct tty_struct *tty, struct file * filp)
 
 	info->tport.count++;
 	tty->driver_data = info;
-	info->tty = tty;
+	tty_port_tty_set(&info->tport, tty);
 
 	/*
 	 * Start up serial port
@@ -1289,7 +1290,6 @@ rs68328_init(void)
 	    tty_port_init(&info->tport);
 	    info->magic = SERIAL_MAGIC;
 	    info->port = (int) &uart_addr[i];
-	    info->tty = NULL;
 	    info->irq = uart_irqs[i];
 	    info->custom_divisor = 16;
 	    info->x_char = 0;
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 62/69] TTY: 68328serial, use tty_port_block_til_ready
       [not found] <1333367693-3244-1-git-send-email-jslaby@suse.cz>
                   ` (10 preceding siblings ...)
  2012-04-02 11:54 ` [PATCH 61/69] TTY: 68328serial, use tty from tty_port Jiri Slaby
@ 2012-04-02 11:54 ` Jiri Slaby
       [not found] ` <1333367693-3244-52-git-send-email-jslaby@suse.cz>
       [not found] ` <1333367693-3244-63-git-send-email-jslaby@suse.cz>
  13 siblings, 0 replies; 14+ messages in thread
From: Jiri Slaby @ 2012-04-02 11:54 UTC (permalink / raw)
  To: gregkh; +Cc: alan, linux-kernel, jirislaby, Geert Uytterhoeven, linux-m68k

Since the code is identical, use the tty_port_block_til_ready helper
instead of re-implemented variant.

The code does not perform rtsdts handling, hence we do not need to
provide tty port hooks for them. The default ones will be used
instead. The only necessary thing is to provide tty_port_operations.
It is empty, but has to be there...

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 drivers/tty/serial/68328serial.c |   96 ++------------------------------------
 1 file changed, 5 insertions(+), 91 deletions(-)

diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index 77e10bb..3ed20e4 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -1104,96 +1104,6 @@ void rs_hangup(struct tty_struct *tty)
 }
 
 /*
- * ------------------------------------------------------------
- * rs_open() and friends
- * ------------------------------------------------------------
- */
-static int block_til_ready(struct tty_struct *tty, struct file * filp,
-			   struct m68k_serial *info)
-{
-	struct tty_port *port = &info->tport;
-	DECLARE_WAITQUEUE(wait, current);
-	int		retval;
-	int		do_clocal = 0;
-
-	/*
-	 * If the device is in the middle of being closed, then block
-	 * until it's done, and then try again.
-	 */
-	if (port->flags & ASYNC_CLOSING) {
-		interruptible_sleep_on(&port->close_wait);
-#ifdef SERIAL_DO_RESTART
-		if (port->flags & ASYNC_HUP_NOTIFY)
-			return -EAGAIN;
-		else
-			return -ERESTARTSYS;
-#else
-		return -EAGAIN;
-#endif
-	}
-	
-	/*
-	 * If non-blocking mode is set, or the port is not enabled,
-	 * then make the check up front and then exit.
-	 */
-	if ((filp->f_flags & O_NONBLOCK) ||
-	    (tty->flags & (1 << TTY_IO_ERROR))) {
-		port->flags |= ASYNC_NORMAL_ACTIVE;
-		return 0;
-	}
-
-	if (tty->termios->c_cflag & CLOCAL)
-		do_clocal = 1;
-
-	/*
-	 * Block waiting for the carrier detect and the line to become
-	 * free (i.e., not in use by the callout).  While we are in
-	 * this loop, port->count is dropped by one, so that
-	 * rs_close() knows when to free things.  We restore it upon
-	 * exit, either normal or abnormal.
-	 */
-	retval = 0;
-	add_wait_queue(&port->open_wait, &wait);
-
-	port->count--;
-	port->blocked_open++;
-	while (1) {
-		current->state = TASK_INTERRUPTIBLE;
-		if (tty_hung_up_p(filp) ||
-		    !(port->flags & ASYNC_INITIALIZED)) {
-#ifdef SERIAL_DO_RESTART
-			if (port->flags & ASYNC_HUP_NOTIFY)
-				retval = -EAGAIN;
-			else
-				retval = -ERESTARTSYS;	
-#else
-			retval = -EAGAIN;
-#endif
-			break;
-		}
-		if (!(port->flags & ASYNC_CLOSING) && do_clocal)
-			break;
-                if (signal_pending(current)) {
-			retval = -ERESTARTSYS;
-			break;
-		}
-		tty_unlock();
-		schedule();
-		tty_lock();
-	}
-	current->state = TASK_RUNNING;
-	remove_wait_queue(&port->open_wait, &wait);
-	if (!tty_hung_up_p(filp))
-		port->count++;
-	port->blocked_open--;
-
-	if (retval)
-		return retval;
-	port->flags |= ASYNC_NORMAL_ACTIVE;
-	return 0;
-}	
-
-/*
  * This routine is called whenever a serial port is opened.  It
  * enables interrupts for a serial port, linking in its S structure into
  * the IRQ chain.   It also performs the serial-specific
@@ -1220,7 +1130,7 @@ int rs_open(struct tty_struct *tty, struct file * filp)
 	if (retval)
 		return retval;
 
-	return block_til_ready(tty, filp, info);
+	return tty_port_block_til_ready(&info->tport, tty, filp);
 }
 
 /* Finally, routines used to initialize the serial driver. */
@@ -1248,6 +1158,9 @@ static const struct tty_operations rs_ops = {
 	.set_ldisc = rs_set_ldisc,
 };
 
+static const struct tty_port_operations rs_port_ops = {
+};
+
 /* rs_init inits the driver */
 static int __init
 rs68328_init(void)
@@ -1288,6 +1201,7 @@ rs68328_init(void)
 
 	    info = &m68k_soft[i];
 	    tty_port_init(&info->tport);
+	    info->tport.ops = &rs_port_ops;
 	    info->magic = SERIAL_MAGIC;
 	    info->port = (int) &uart_addr[i];
 	    info->irq = uart_irqs[i];
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 51/69] TTY: 68328serial, remove serial_state and friends
       [not found] ` <1333367693-3244-52-git-send-email-jslaby@suse.cz>
@ 2012-04-03 12:48   ` Geert Uytterhoeven
  0 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2012-04-03 12:48 UTC (permalink / raw)
  To: linux-m68k, Greg Ungerer; +Cc: gregkh, alan, linux-kernel, jirislaby

[ Added Greg as this is m68knommu territory, but I guess he go all 12 patches
  through linux-m68k anyway ]

On Mon, Apr 2, 2012 at 13:54, Jiri Slaby <jslaby@suse.cz> wrote:
> serial_state in 68328serial.h is a duplicated structure. One is
> defined in linux/serial.h. So let us use that instead. And since the
> serial flags are identical, use ones from there too.
>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: linux-m68k@lists.linux-m68k.org
> ---
>  drivers/tty/serial/68328serial.c |   55 +++++++++++----------------
>  drivers/tty/serial/68328serial.h |   76 --------------------------------------
>  2 files changed, 22 insertions(+), 109 deletions(-)
>
> diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
> index 5ce7825..bf5f811 100644
> --- a/drivers/tty/serial/68328serial.c
> +++ b/drivers/tty/serial/68328serial.c
> @@ -17,6 +17,7 @@
>  #include <asm/dbg.h>
>  #include <linux/module.h>
>  #include <linux/errno.h>
> +#include <linux/serial.h>
>  #include <linux/signal.h>
>  #include <linux/sched.h>
>  #include <linux/timer.h>
> @@ -79,18 +80,6 @@ struct m68k_serial *m68k_consinfo = 0;
>
>  struct tty_driver *serial_driver;
>
> -/* number of characters left in xmit buffer before we ask for more */
> -#define WAKEUP_CHARS 256
> -
> -/* Debugging... DEBUG_INTR is bad to use when one of the zs
> - * lines is your console ;(
> - */
> -#undef SERIAL_DEBUG_INTR
> -#undef SERIAL_DEBUG_OPEN
> -#undef SERIAL_DEBUG_FLOW
> -
> -#define RS_ISR_PASS_LIMIT 256
> -
>  static void change_speed(struct m68k_serial *info);
>
>  /*
> @@ -363,7 +352,7 @@ static int startup(struct m68k_serial * info)
>        m68328_uart *uart = &uart_addr[info->line];
>        unsigned long flags;
>
> -       if (info->flags & S_INITIALIZED)
> +       if (info->flags & ASYNC_INITIALIZED)
>                return 0;
>
>        if (!info->xmit_buf) {
> @@ -404,7 +393,7 @@ static int startup(struct m68k_serial * info)
>
>        change_speed(info);
>
> -       info->flags |= S_INITIALIZED;
> +       info->flags |= ASYNC_INITIALIZED;
>        local_irq_restore(flags);
>        return 0;
>  }
> @@ -419,7 +408,7 @@ static void shutdown(struct m68k_serial * info)
>        unsigned long   flags;
>
>        uart->ustcnt = 0; /* All off! */
> -       if (!(info->flags & S_INITIALIZED))
> +       if (!(info->flags & ASYNC_INITIALIZED))
>                return;
>
>        local_irq_save(flags);
> @@ -432,7 +421,7 @@ static void shutdown(struct m68k_serial * info)
>        if (info->tty)
>                set_bit(TTY_IO_ERROR, &info->tty->flags);
>
> -       info->flags &= ~S_INITIALIZED;
> +       info->flags &= ~ASYNC_INITIALIZED;
>        local_irq_restore(flags);
>  }
>
> @@ -835,11 +824,11 @@ static int set_serial_info(struct m68k_serial * info,
>                if ((new_serial.baud_base != info->baud_base) ||
>                    (new_serial.type != info->type) ||
>                    (new_serial.close_delay != info->close_delay) ||
> -                   ((new_serial.flags & ~S_USR_MASK) !=
> -                    (info->flags & ~S_USR_MASK)))
> +                   ((new_serial.flags & ~ASYNC_USR_MASK) !=
> +                    (info->flags & ~ASYNC_USR_MASK)))
>                        return -EPERM;
> -               info->flags = ((info->flags & ~S_USR_MASK) |
> -                              (new_serial.flags & S_USR_MASK));
> +               info->flags = ((info->flags & ~ASYNC_USR_MASK) |
> +                              (new_serial.flags & ASYNC_USR_MASK));
>                info->custom_divisor = new_serial.custom_divisor;
>                goto check_and_exit;
>        }
> @@ -853,8 +842,8 @@ static int set_serial_info(struct m68k_serial * info,
>         */
>
>        info->baud_base = new_serial.baud_base;
> -       info->flags = ((info->flags & ~S_FLAGS) |
> -                       (new_serial.flags & S_FLAGS));
> +       info->flags = ((info->flags & ~ASYNC_FLAGS) |
> +                       (new_serial.flags & ASYNC_FLAGS));
>        info->type = new_serial.type;
>        info->close_delay = new_serial.close_delay;
>        info->closing_wait = new_serial.closing_wait;
> @@ -1022,13 +1011,13 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
>                local_irq_restore(flags);
>                return;
>        }
> -       info->flags |= S_CLOSING;
> +       info->flags |= ASYNC_CLOSING;
>        /*
>         * Now we wait for the transmit buffer to clear; and we notify
>         * the line discipline to only process XON/XOFF characters.
>         */
>        tty->closing = 1;
> -       if (info->closing_wait != S_CLOSING_WAIT_NONE)
> +       if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE)
>                tty_wait_until_sent(tty, info->closing_wait);
>        /*
>         * At this point we stop accepting input.  To do this, we
> @@ -1064,7 +1053,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
>                }
>                wake_up_interruptible(&info->open_wait);
>        }
> -       info->flags &= ~(S_NORMAL_ACTIVE|S_CLOSING);
> +       info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
>        wake_up_interruptible(&info->close_wait);
>        local_irq_restore(flags);
>  }
> @@ -1083,7 +1072,7 @@ void rs_hangup(struct tty_struct *tty)
>        shutdown(info);
>        info->event = 0;
>        info->count = 0;
> -       info->flags &= ~S_NORMAL_ACTIVE;
> +       info->flags &= ~ASYNC_NORMAL_ACTIVE;
>        info->tty = NULL;
>        wake_up_interruptible(&info->open_wait);
>  }
> @@ -1104,10 +1093,10 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
>         * If the device is in the middle of being closed, then block
>         * until it's done, and then try again.
>         */
> -       if (info->flags & S_CLOSING) {
> +       if (info->flags & ASYNC_CLOSING) {
>                interruptible_sleep_on(&info->close_wait);
>  #ifdef SERIAL_DO_RESTART
> -               if (info->flags & S_HUP_NOTIFY)
> +               if (info->flags & ASYNC_HUP_NOTIFY)
>                        return -EAGAIN;
>                else
>                        return -ERESTARTSYS;
> @@ -1122,7 +1111,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
>         */
>        if ((filp->f_flags & O_NONBLOCK) ||
>            (tty->flags & (1 << TTY_IO_ERROR))) {
> -               info->flags |= S_NORMAL_ACTIVE;
> +               info->flags |= ASYNC_NORMAL_ACTIVE;
>                return 0;
>        }
>
> @@ -1147,9 +1136,9 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
>                local_irq_enable();
>                current->state = TASK_INTERRUPTIBLE;
>                if (tty_hung_up_p(filp) ||
> -                   !(info->flags & S_INITIALIZED)) {
> +                   !(info->flags & ASYNC_INITIALIZED)) {
>  #ifdef SERIAL_DO_RESTART
> -                       if (info->flags & S_HUP_NOTIFY)
> +                       if (info->flags & ASYNC_HUP_NOTIFY)
>                                retval = -EAGAIN;
>                        else
>                                retval = -ERESTARTSYS;
> @@ -1158,7 +1147,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
>  #endif
>                        break;
>                }
> -               if (!(info->flags & S_CLOSING) && do_clocal)
> +               if (!(info->flags & ASYNC_CLOSING) && do_clocal)
>                        break;
>                 if (signal_pending(current)) {
>                        retval = -ERESTARTSYS;
> @@ -1176,7 +1165,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
>
>        if (retval)
>                return retval;
> -       info->flags |= S_NORMAL_ACTIVE;
> +       info->flags |= ASYNC_NORMAL_ACTIVE;
>        return 0;
>  }
>
> diff --git a/drivers/tty/serial/68328serial.h b/drivers/tty/serial/68328serial.h
> index 3d2faab..a804ea5 100644
> --- a/drivers/tty/serial/68328serial.h
> +++ b/drivers/tty/serial/68328serial.h
> @@ -11,69 +11,6 @@
>  #ifndef _MC683XX_SERIAL_H
>  #define _MC683XX_SERIAL_H
>
> -
> -struct serial_struct {
> -       int     type;
> -       int     line;
> -       int     port;
> -       int     irq;
> -       int     flags;
> -       int     xmit_fifo_size;
> -       int     custom_divisor;
> -       int     baud_base;
> -       unsigned short  close_delay;
> -       char    reserved_char[2];
> -       int     hub6;  /* FIXME: We don't have AT&T Hub6 boards! */
> -       unsigned short  closing_wait; /* time to wait before closing */
> -       unsigned short  closing_wait2; /* no longer used... */
> -       int     reserved[4];
> -};
> -
> -/*
> - * For the close wait times, 0 means wait forever for serial port to
> - * flush its output.  65535 means don't wait at all.
> - */
> -#define S_CLOSING_WAIT_INF     0
> -#define S_CLOSING_WAIT_NONE    65535
> -
> -/*
> - * Definitions for S_struct (and serial_struct) flags field
> - */
> -#define S_HUP_NOTIFY 0x0001 /* Notify getty on hangups and closes
> -                                  on the callout port */
> -#define S_FOURPORT  0x0002     /* Set OU1, OUT2 per AST Fourport settings */
> -#define S_SAK  0x0004  /* Secure Attention Key (Orange book) */
> -#define S_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */
> -
> -#define S_SPD_MASK     0x0030
> -#define S_SPD_HI       0x0010  /* Use 56000 instead of 38400 bps */
> -
> -#define S_SPD_VHI      0x0020  /* Use 115200 instead of 38400 bps */
> -#define S_SPD_CUST     0x0030  /* Use user-specified divisor */
> -
> -#define S_SKIP_TEST    0x0040 /* Skip UART test during autoconfiguration */
> -#define S_AUTO_IRQ  0x0080 /* Do automatic IRQ during autoconfiguration */
> -#define S_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */
> -#define S_PGRP_LOCKOUT    0x0200 /* Lock out cua opens based on pgrp */
> -#define S_CALLOUT_NOHUP   0x0400 /* Don't do hangups for cua device */
> -
> -#define S_FLAGS        0x0FFF  /* Possible legal S flags */
> -#define S_USR_MASK 0x0430      /* Legal flags that non-privileged
> -                                * users can set or reset */
> -
> -/* Internal flags used only by kernel/chr_drv/serial.c */
> -#define S_INITIALIZED  0x80000000 /* Serial port was initialized */
> -#define S_CALLOUT_ACTIVE       0x40000000 /* Call out device is active */
> -#define S_NORMAL_ACTIVE        0x20000000 /* Normal device is active */
> -#define S_BOOT_AUTOCONF        0x10000000 /* Autoconfigure port on bootup */
> -#define S_CLOSING              0x08000000 /* Serial port is closing */
> -#define S_CTS_FLOW             0x04000000 /* Do CTS flow control */
> -#define S_CHECK_CD             0x02000000 /* i.e., CLOCAL */
> -
> -/* Software state per channel */
> -
> -#ifdef __KERNEL__
> -
>  /*
>  * I believe this is the optimal setting that reduces the number of interrupts.
>  * At high speeds the output might become a little "bursted" (use USTCNT_TXHE
> @@ -162,25 +99,12 @@ struct m68k_serial {
>        wait_queue_head_t       close_wait;
>  };
>
> -
>  #define SERIAL_MAGIC 0x5301
>
> -/*
> - * The size of the serial xmit buffer is 1 page, or 4096 bytes
> - */
> -#define SERIAL_XMIT_SIZE 4096
> -
> -/*
> - * Events are used to schedule things to happen at timer-interrupt
> - * time, instead of at rs interrupt time.
> - */
> -#define RS_EVENT_WRITE_WAKEUP  0
> -
>  /*
>  * Define the number of ports supported and their irqs.
>  */
>  #define NR_PORTS 1
>  #define UART_IRQ_DEFNS {UART_IRQ_NUM}
>
> -#endif /* __KERNEL__ */
>  #endif /* !(_MC683XX_SERIAL_H) */
> --
> 1.7.9.2

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 62/69] TTY: 68328serial, use tty_port_block_til_ready
       [not found] ` <1333367693-3244-63-git-send-email-jslaby@suse.cz>
@ 2012-04-04 12:25   ` Greg Ungerer
  0 siblings, 0 replies; 14+ messages in thread
From: Greg Ungerer @ 2012-04-04 12:25 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: gregkh, alan, linux-kernel, jirislaby, Geert Uytterhoeven,
	linux-m68k

Hi Jiri,

On 04/02/2012 09:54 PM, Jiri Slaby wrote:
> Since the code is identical, use the tty_port_block_til_ready helper
> instead of re-implemented variant.
>
> The code does not perform rtsdts handling, hence we do not need to
> provide tty port hooks for them. The default ones will be used
> instead. The only necessary thing is to provide tty_port_operations.
> It is empty, but has to be there...
>
> Signed-off-by: Jiri Slaby<jslaby@suse.cz>
> Cc: Geert Uytterhoeven<geert@linux-m68k.org>
> Cc: linux-m68k@lists.linux-m68k.org

I have no problem with any of the 12 patches that work on 68328serial.
So for me:

Acked-by: Greg Ungerer <gerg@uclinux.org>

I myself have nothing to test it on though.

Really the only thing remaining is to convert it to a new style serial
driver. Don't suppose you want to take that on :-)

Regards
Greg



> ---
>   drivers/tty/serial/68328serial.c |   96 ++------------------------------------
>   1 file changed, 5 insertions(+), 91 deletions(-)
>
> diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
> index 77e10bb..3ed20e4 100644
> --- a/drivers/tty/serial/68328serial.c
> +++ b/drivers/tty/serial/68328serial.c
> @@ -1104,96 +1104,6 @@ void rs_hangup(struct tty_struct *tty)
>   }
>
>   /*
> - * ------------------------------------------------------------
> - * rs_open() and friends
> - * ------------------------------------------------------------
> - */
> -static int block_til_ready(struct tty_struct *tty, struct file * filp,
> -			   struct m68k_serial *info)
> -{
> -	struct tty_port *port =&info->tport;
> -	DECLARE_WAITQUEUE(wait, current);
> -	int		retval;
> -	int		do_clocal = 0;
> -
> -	/*
> -	 * If the device is in the middle of being closed, then block
> -	 * until it's done, and then try again.
> -	 */
> -	if (port->flags&  ASYNC_CLOSING) {
> -		interruptible_sleep_on(&port->close_wait);
> -#ifdef SERIAL_DO_RESTART
> -		if (port->flags&  ASYNC_HUP_NOTIFY)
> -			return -EAGAIN;
> -		else
> -			return -ERESTARTSYS;
> -#else
> -		return -EAGAIN;
> -#endif
> -	}
> -	
> -	/*
> -	 * If non-blocking mode is set, or the port is not enabled,
> -	 * then make the check up front and then exit.
> -	 */
> -	if ((filp->f_flags&  O_NONBLOCK) ||
> -	    (tty->flags&  (1<<  TTY_IO_ERROR))) {
> -		port->flags |= ASYNC_NORMAL_ACTIVE;
> -		return 0;
> -	}
> -
> -	if (tty->termios->c_cflag&  CLOCAL)
> -		do_clocal = 1;
> -
> -	/*
> -	 * Block waiting for the carrier detect and the line to become
> -	 * free (i.e., not in use by the callout).  While we are in
> -	 * this loop, port->count is dropped by one, so that
> -	 * rs_close() knows when to free things.  We restore it upon
> -	 * exit, either normal or abnormal.
> -	 */
> -	retval = 0;
> -	add_wait_queue(&port->open_wait,&wait);
> -
> -	port->count--;
> -	port->blocked_open++;
> -	while (1) {
> -		current->state = TASK_INTERRUPTIBLE;
> -		if (tty_hung_up_p(filp) ||
> -		    !(port->flags&  ASYNC_INITIALIZED)) {
> -#ifdef SERIAL_DO_RESTART
> -			if (port->flags&  ASYNC_HUP_NOTIFY)
> -				retval = -EAGAIN;
> -			else
> -				retval = -ERESTARTSYS;	
> -#else
> -			retval = -EAGAIN;
> -#endif
> -			break;
> -		}
> -		if (!(port->flags&  ASYNC_CLOSING)&&  do_clocal)
> -			break;
> -                if (signal_pending(current)) {
> -			retval = -ERESTARTSYS;
> -			break;
> -		}
> -		tty_unlock();
> -		schedule();
> -		tty_lock();
> -	}
> -	current->state = TASK_RUNNING;
> -	remove_wait_queue(&port->open_wait,&wait);
> -	if (!tty_hung_up_p(filp))
> -		port->count++;
> -	port->blocked_open--;
> -
> -	if (retval)
> -		return retval;
> -	port->flags |= ASYNC_NORMAL_ACTIVE;
> -	return 0;
> -}	
> -
> -/*
>    * This routine is called whenever a serial port is opened.  It
>    * enables interrupts for a serial port, linking in its S structure into
>    * the IRQ chain.   It also performs the serial-specific
> @@ -1220,7 +1130,7 @@ int rs_open(struct tty_struct *tty, struct file * filp)
>   	if (retval)
>   		return retval;
>
> -	return block_til_ready(tty, filp, info);
> +	return tty_port_block_til_ready(&info->tport, tty, filp);
>   }
>
>   /* Finally, routines used to initialize the serial driver. */
> @@ -1248,6 +1158,9 @@ static const struct tty_operations rs_ops = {
>   	.set_ldisc = rs_set_ldisc,
>   };
>
> +static const struct tty_port_operations rs_port_ops = {
> +};
> +
>   /* rs_init inits the driver */
>   static int __init
>   rs68328_init(void)
> @@ -1288,6 +1201,7 @@ rs68328_init(void)
>
>   	    info =&m68k_soft[i];
>   	    tty_port_init(&info->tport);
> +	    info->tport.ops =&rs_port_ops;
>   	    info->magic = SERIAL_MAGIC;
>   	    info->port = (int)&uart_addr[i];
>   	    info->irq = uart_irqs[i];


-- 
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     gerg@snapgear.com
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close,                            FAX:         +61 7 3891 3630
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-04-04 12:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1333367693-3244-1-git-send-email-jslaby@suse.cz>
2012-04-02 11:54 ` [PATCH 51/69] TTY: 68328serial, remove serial_state and friends Jiri Slaby
2012-04-02 11:54 ` [PATCH 52/69] TTY: 68328serial, remove unused stuff from m68k_serial Jiri Slaby
2012-04-02 11:54 ` [PATCH 53/69] TTY: 68328serial, remove garbage Jiri Slaby
2012-04-02 11:54 ` [PATCH 54/69] TTY: 68328serial, use ulong flags for interrupts status Jiri Slaby
2012-04-02 11:54 ` [PATCH 55/69] TTY: 68328serial, remove 68328serial.h Jiri Slaby
2012-04-02 11:54 ` [PATCH 56/69] TTY: 68328serial, add tty_port Jiri Slaby
2012-04-02 11:54 ` [PATCH 57/69] TTY: 68328serial, use open/close_wait from tty_port Jiri Slaby
2012-04-02 11:54 ` [PATCH 58/69] TTY: 68328serial, use close_delay/closing_wait " Jiri Slaby
2012-04-02 11:54 ` [PATCH 59/69] TTY: 68328serial, use flags " Jiri Slaby
2012-04-02 11:54 ` [PATCH 60/69] TTY: 68328serial, propagate tty Jiri Slaby
2012-04-02 11:54 ` [PATCH 61/69] TTY: 68328serial, use tty from tty_port Jiri Slaby
2012-04-02 11:54 ` [PATCH 62/69] TTY: 68328serial, use tty_port_block_til_ready Jiri Slaby
     [not found] ` <1333367693-3244-52-git-send-email-jslaby@suse.cz>
2012-04-03 12:48   ` [PATCH 51/69] TTY: 68328serial, remove serial_state and friends Geert Uytterhoeven
     [not found] ` <1333367693-3244-63-git-send-email-jslaby@suse.cz>
2012-04-04 12:25   ` [PATCH 62/69] TTY: 68328serial, use tty_port_block_til_ready Greg Ungerer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox