aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2008-07-25 04:48:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 13:53:44 -0400
commitace7dd96695769f9d76980c7e52139e73228221c (patch)
treedd45e597af2b612c9467eb75ea88c1313ca4fffc /drivers/char
parent1df0092477b8b2df605812e298624f5c35bb4805 (diff)
Char: mxser, various cleanups
- remove unused macro - some whitespace cleanup - useless debug prints removal Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/mxser.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 9b4d03cf4e1d..e30575e87648 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -48,7 +48,6 @@
48 48
49#define MXSER_VERSION "2.0.4" /* 1.12 */ 49#define MXSER_VERSION "2.0.4" /* 1.12 */
50#define MXSERMAJOR 174 50#define MXSERMAJOR 174
51#define MXSERCUMAJOR 175
52 51
53#define MXSER_BOARDS 4 /* Max. boards */ 52#define MXSER_BOARDS 4 /* Max. boards */
54#define MXSER_PORTS_PER_BOARD 8 /* Max. ports per board */ 53#define MXSER_PORTS_PER_BOARD 8 /* Max. ports per board */
@@ -191,7 +190,6 @@ struct mxser_log {
191 unsigned long txcnt[MXSER_PORTS]; 190 unsigned long txcnt[MXSER_PORTS];
192}; 191};
193 192
194
195struct mxser_mon { 193struct mxser_mon {
196 unsigned long rxcnt; 194 unsigned long rxcnt;
197 unsigned long txcnt; 195 unsigned long txcnt;
@@ -1305,13 +1303,9 @@ static void mxser_flush_chars(struct tty_struct *tty)
1305 struct mxser_port *info = tty->driver_data; 1303 struct mxser_port *info = tty->driver_data;
1306 unsigned long flags; 1304 unsigned long flags;
1307 1305
1308 if (info->xmit_cnt <= 0 || 1306 if (info->xmit_cnt <= 0 || tty->stopped || !info->port.xmit_buf ||
1309 tty->stopped || 1307 (tty->hw_stopped && info->type != PORT_16550A &&
1310 !info->port.xmit_buf || 1308 !info->board->chip_flag))
1311 (tty->hw_stopped &&
1312 (info->type != PORT_16550A) &&
1313 (!info->board->chip_flag)
1314 ))
1315 return; 1309 return;
1316 1310
1317 spin_lock_irqsave(&info->slock, flags); 1311 spin_lock_irqsave(&info->slock, flags);
@@ -1329,9 +1323,7 @@ static int mxser_write_room(struct tty_struct *tty)
1329 int ret; 1323 int ret;
1330 1324
1331 ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1; 1325 ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
1332 if (ret < 0) 1326 return ret < 0 ? 0 : ret;
1333 ret = 0;
1334 return ret;
1335} 1327}
1336 1328
1337static int mxser_chars_in_buffer(struct tty_struct *tty) 1329static int mxser_chars_in_buffer(struct tty_struct *tty)
@@ -2762,8 +2754,6 @@ static int __init mxser_module_init(void)
2762 unsigned int b, i, m; 2754 unsigned int b, i, m;
2763 int retval; 2755 int retval;
2764 2756
2765 pr_debug("Loading module mxser ...\n");
2766
2767 mxvar_sdriver = alloc_tty_driver(MXSER_PORTS + 1); 2757 mxvar_sdriver = alloc_tty_driver(MXSER_PORTS + 1);
2768 if (!mxvar_sdriver) 2758 if (!mxvar_sdriver)
2769 return -ENOMEM; 2759 return -ENOMEM;
@@ -2829,8 +2819,6 @@ static int __init mxser_module_init(void)
2829 } /* else: we have some ISA cards under control */ 2819 } /* else: we have some ISA cards under control */
2830 } 2820 }
2831 2821
2832 pr_debug("Done.\n");
2833
2834 return 0; 2822 return 0;
2835err_unr: 2823err_unr:
2836 tty_unregister_driver(mxvar_sdriver); 2824 tty_unregister_driver(mxvar_sdriver);
@@ -2843,8 +2831,6 @@ static void __exit mxser_module_exit(void)
2843{ 2831{
2844 unsigned int i, j; 2832 unsigned int i, j;
2845 2833
2846 pr_debug("Unloading module mxser ...\n");
2847
2848 pci_unregister_driver(&mxser_driver); 2834 pci_unregister_driver(&mxser_driver);
2849 2835
2850 for (i = 0; i < MXSER_BOARDS; i++) /* ISA remains */ 2836 for (i = 0; i < MXSER_BOARDS; i++) /* ISA remains */
@@ -2858,8 +2844,6 @@ static void __exit mxser_module_exit(void)
2858 for (i = 0; i < MXSER_BOARDS; i++) 2844 for (i = 0; i < MXSER_BOARDS; i++)
2859 if (mxser_boards[i].info != NULL) 2845 if (mxser_boards[i].info != NULL)
2860 mxser_release_res(&mxser_boards[i], NULL, 1); 2846 mxser_release_res(&mxser_boards[i], NULL, 1);
2861
2862 pr_debug("Done.\n");
2863} 2847}
2864 2848
2865module_init(mxser_module_init); 2849module_init(mxser_module_init);