aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/sx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/sx.c')
-rw-r--r--drivers/char/sx.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index c2490e270f1f..a6b4f02bdceb 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -1095,17 +1095,17 @@ static inline void sx_receive_chars (struct sx_port *port)
1095 1095
1096 sx_dprintk (SX_DEBUG_RECEIVE, "rxop=%d, c = %d.\n", rx_op, c); 1096 sx_dprintk (SX_DEBUG_RECEIVE, "rxop=%d, c = %d.\n", rx_op, c);
1097 1097
1098 /* Don't copy past the end of the hardware receive buffer */
1099 if (rx_op + c > 0x100) c = 0x100 - rx_op;
1100
1101 sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c);
1102
1098 /* Don't copy more bytes than there is room for in the buffer */ 1103 /* Don't copy more bytes than there is room for in the buffer */
1099 1104
1100 c = tty_prepare_flip_string(tty, &rp, c); 1105 c = tty_prepare_flip_string(tty, &rp, c);
1101 1106
1102 sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); 1107 sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c);
1103 1108
1104 /* Don't copy past the end of the hardware receive buffer */
1105 if (rx_op + c > 0x100) c = 0x100 - rx_op;
1106
1107 sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c);
1108
1109 /* If for one reason or another, we can't copy more data, we're done! */ 1109 /* If for one reason or another, we can't copy more data, we're done! */
1110 if (c == 0) break; 1110 if (c == 0) break;
1111 1111
@@ -2173,15 +2173,17 @@ static int probe_si (struct sx_board *board)
2173 if ( IS_SI1_BOARD(board)) { 2173 if ( IS_SI1_BOARD(board)) {
2174 /* This should be an SI1 board, which has this 2174 /* This should be an SI1 board, which has this
2175 location writable... */ 2175 location writable... */
2176 if (read_sx_byte (board, SI2_ISA_ID_BASE) != 0x10) 2176 if (read_sx_byte (board, SI2_ISA_ID_BASE) != 0x10) {
2177 func_exit (); 2177 func_exit ();
2178 return 0; 2178 return 0;
2179 }
2179 } else { 2180 } else {
2180 /* This should be an SI2 board, which has the bottom 2181 /* This should be an SI2 board, which has the bottom
2181 3 bits non-writable... */ 2182 3 bits non-writable... */
2182 if (read_sx_byte (board, SI2_ISA_ID_BASE) == 0x10) 2183 if (read_sx_byte (board, SI2_ISA_ID_BASE) == 0x10) {
2183 func_exit (); 2184 func_exit ();
2184 return 0; 2185 return 0;
2186 }
2185 } 2187 }
2186 2188
2187 /* Now we're pretty much convinced that there is an SI board here, 2189 /* Now we're pretty much convinced that there is an SI board here,
@@ -2192,15 +2194,17 @@ static int probe_si (struct sx_board *board)
2192 if ( IS_SI1_BOARD(board)) { 2194 if ( IS_SI1_BOARD(board)) {
2193 /* This should be an SI1 board, which has this 2195 /* This should be an SI1 board, which has this
2194 location writable... */ 2196 location writable... */
2195 if (read_sx_byte (board, SI2_ISA_ID_BASE) != 0x10) 2197 if (read_sx_byte (board, SI2_ISA_ID_BASE) != 0x10) {
2196 func_exit(); 2198 func_exit();
2197 return 0; 2199 return 0;
2200 }
2198 } else { 2201 } else {
2199 /* This should be an SI2 board, which has the bottom 2202 /* This should be an SI2 board, which has the bottom
2200 3 bits non-writable... */ 2203 3 bits non-writable... */
2201 if (read_sx_byte (board, SI2_ISA_ID_BASE) == 0x10) 2204 if (read_sx_byte (board, SI2_ISA_ID_BASE) == 0x10) {
2202 func_exit (); 2205 func_exit ();
2203 return 0; 2206 return 0;
2207 }
2204 } 2208 }
2205 2209
2206 printheader (); 2210 printheader ();