aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-03-05 08:52:42 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-08 15:48:28 -0500
commit6e9ebcfa20b15f0ccdd4b5395a3c63f79c21fa57 (patch)
tree436c9c72915d0d727b67d473401776a55c7308cb /arch/ia64
parentf66279cd7d5cdf43686da0d9ed20378581b88d0f (diff)
TTY: simserial, final cleanup
* remove pointless checks (tty cannot be NULL at that points) * fix some printks (use __func__, print text directly w/o using global strings) * remove some empty lines This is the last patch for simserial. Overall, the driver is 400 lines shorter. Being now at 560 lines. It was tested using ski with a busybox userspace. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/hp/sim/simserial.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
index 516ad09f3131..c34785dca92b 100644
--- a/arch/ia64/hp/sim/simserial.c
+++ b/arch/ia64/hp/sim/simserial.c
@@ -47,9 +47,6 @@ struct serial_state {
47 int x_char; 47 int x_char;
48}; 48};
49 49
50static char *serial_name = "SimSerial driver";
51static char *serial_version = "0.6";
52
53static struct serial_state rs_table[NR_PORTS]; 50static struct serial_state rs_table[NR_PORTS];
54 51
55struct tty_driver *hp_simserial_driver; 52struct tty_driver *hp_simserial_driver;
@@ -99,7 +96,7 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id)
99 struct tty_struct *tty = tty_port_tty_get(&info->port); 96 struct tty_struct *tty = tty_port_tty_get(&info->port);
100 97
101 if (!tty) { 98 if (!tty) {
102 printk(KERN_INFO "simrs_interrupt_single: info|tty=0 info=%p problem\n", info); 99 printk(KERN_INFO "%s: tty=0 problem\n", __func__);
103 return IRQ_NONE; 100 return IRQ_NONE;
104 } 101 }
105 /* 102 /*
@@ -122,7 +119,7 @@ static int rs_put_char(struct tty_struct *tty, unsigned char ch)
122 struct serial_state *info = tty->driver_data; 119 struct serial_state *info = tty->driver_data;
123 unsigned long flags; 120 unsigned long flags;
124 121
125 if (!tty || !info->xmit.buf) 122 if (!info->xmit.buf)
126 return 0; 123 return 0;
127 124
128 local_irq_save(flags); 125 local_irq_save(flags);
@@ -199,7 +196,6 @@ static void rs_flush_chars(struct tty_struct *tty)
199 transmit_chars(tty, info, NULL); 196 transmit_chars(tty, info, NULL);
200} 197}
201 198
202
203static int rs_write(struct tty_struct * tty, 199static int rs_write(struct tty_struct * tty,
204 const unsigned char *buf, int count) 200 const unsigned char *buf, int count)
205{ 201{
@@ -207,7 +203,7 @@ static int rs_write(struct tty_struct * tty,
207 int c, ret = 0; 203 int c, ret = 0;
208 unsigned long flags; 204 unsigned long flags;
209 205
210 if (!tty || !info->xmit.buf) 206 if (!info->xmit.buf)
211 return 0; 207 return 0;
212 208
213 local_irq_save(flags); 209 local_irq_save(flags);
@@ -309,7 +305,6 @@ static void rs_unthrottle(struct tty_struct * tty)
309 printk(KERN_INFO "simrs_unthrottle called\n"); 305 printk(KERN_INFO "simrs_unthrottle called\n");
310} 306}
311 307
312
313static int rs_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) 308static int rs_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
314{ 309{
315 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && 310 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -462,7 +457,7 @@ static int rs_proc_show(struct seq_file *m, void *v)
462{ 457{
463 int i; 458 int i;
464 459
465 seq_printf(m, "simserinfo:1.0 driver:%s\n", serial_version); 460 seq_printf(m, "simserinfo:1.0\n");
466 for (i = 0; i < NR_PORTS; i++) 461 for (i = 0; i < NR_PORTS; i++)
467 seq_printf(m, "%d: uart:16550 port:3F8 irq:%d\n", 462 seq_printf(m, "%d: uart:16550 port:3F8 irq:%d\n",
468 i, rs_table[i].irq); 463 i, rs_table[i].irq);
@@ -482,12 +477,6 @@ static const struct file_operations rs_proc_fops = {
482 .release = single_release, 477 .release = single_release,
483}; 478};
484 479
485static inline void show_serial_version(void)
486{
487 printk(KERN_INFO "%s version %s with", serial_name, serial_version);
488 printk(KERN_INFO " no serial options enabled\n");
489}
490
491static const struct tty_operations hp_ops = { 480static const struct tty_operations hp_ops = {
492 .open = rs_open, 481 .open = rs_open,
493 .close = rs_close, 482 .close = rs_close,
@@ -523,7 +512,7 @@ static int __init simrs_init(void)
523 if (!hp_simserial_driver) 512 if (!hp_simserial_driver)
524 return -ENOMEM; 513 return -ENOMEM;
525 514
526 show_serial_version(); 515 printk(KERN_INFO "SimSerial driver with no serial options enabled\n");
527 516
528 /* Initialize the tty_driver structure */ 517 /* Initialize the tty_driver structure */
529 518