Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Mark Mason" <mason@broadcom.com>
To: linux-mips@linux-mips.org
Subject: [patch] sb1250 serial patch
Date: Tue, 17 Jan 2006 12:05:25 -0800	[thread overview]
Message-ID: <20060117200525.GD19531@localhost.localdomain> (raw)

Hello all,

The recent git import changed some of the tty datastructures, and subsequently broke the special sb1250 serial driver.  This patch fixes that broken-ness, and cleans up some compilation warnings as well.
Please apply - Thanks.

[Yes - the driver needs a rewrite.  It's on our to-do list.  Really.  I promise...]

Mark


diff --git a/drivers/char/sb1250_duart.c b/drivers/char/sb1250_duart.c
--- a/drivers/char/sb1250_duart.c
+++ b/drivers/char/sb1250_duart.c
@@ -105,14 +105,14 @@ typedef struct { 
 	unsigned long       flags;
 	struct tty_struct   *tty;
 	/* CSR addresses */
-	u32		    *status;
-	u32		    *imr;
-	u32		    *tx_hold;
-	u32		    *rx_hold;
-	u32		    *mode_1;
-	u32		    *mode_2;
-	u32		    *clk_sel;
-	u32		    *cmd;
+	volatile u32	    *status;
+	volatile u32	    *imr;
+	volatile u32	    *tx_hold;
+	volatile u32	    *rx_hold;
+	volatile u32	    *mode_1;
+	volatile u32	    *mode_2;
+	volatile u32	    *clk_sel;
+	volatile u32	    *cmd;
 } uart_state_t;
 
 static uart_state_t uart_states[DUART_MAX_LINE];
@@ -130,7 +130,7 @@ static uart_state_t uart_states[DUART_MA
 static unsigned int last_mode1[DUART_MAX_LINE];
 #endif
 
-static inline u32 READ_SERCSR(u32 *addr, int line)
+static inline u32 READ_SERCSR(volatile u32 *addr, int line)
 {
 	u32 val = csr_in32(addr);
 #if SIBYTE_1956_WAR
@@ -139,7 +139,7 @@ static inline u32 READ_SERCSR(u32 *addr,
 	return val;
 }
 
-static inline void WRITE_SERCSR(u32 val, u32 *addr, int line)
+static inline void WRITE_SERCSR(u32 val, volatile u32 *addr, int line)
 {
 	csr_out32(val, addr);
 #if SIBYTE_1956_WAR
@@ -258,11 +258,7 @@ static irqreturn_t duart_int(int irq, vo
 			if (!(READ_SERCSR(us->status, us->line) & M_DUART_RX_RDY))
 				break;
 			ch = READ_SERCSR(us->rx_hold, us->line);
-			if (tty->flip.count < TTY_FLIPBUF_SIZE) {
-				*tty->flip.char_buf_ptr++ = ch;
-				*tty->flip.flag_buf_ptr++ = 0;
-				tty->flip.count++;
-			}
+			tty_insert_flip_char(tty, ch, 0);
 			udelay(1);
 			counter--;
 		}

             reply	other threads:[~2006-01-17 20:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-17 20:05 Mark Mason [this message]
2006-01-19  0:45 ` [patch] sb1250 serial patch Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060117200525.GD19531@localhost.localdomain \
    --to=mason@broadcom.com \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox