aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/rio/riotty.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-03-24 06:18:27 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:29 -0500
commite2b3afd676ad3e15ca2efca3b3605c7d817ec6e3 (patch)
treef6b7c9739e20a865b6f1f379ccbab67a63ddec53 /drivers/char/rio/riotty.c
parent27c6e526f34760a9c48a90112242b7165064fa85 (diff)
[PATCH] rio driver rework continued #2
First large chunk of code cleanup. The split between this and #3 and #4 is fairly arbitary and due to the message length limit on the list. These patches continue the process of ripping out macros and typedefs while cleaning up lots of 32bit assumptions. Several inlines for compatibility also get removed and that causes a lot of noise. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/rio/riotty.c')
-rw-r--r--drivers/char/rio/riotty.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/char/rio/riotty.c b/drivers/char/rio/riotty.c
index 6379816ed173..0ca431b4c474 100644
--- a/drivers/char/rio/riotty.c
+++ b/drivers/char/rio/riotty.c
@@ -136,7 +136,7 @@ extern struct rio_info *p;
136 136
137int riotopen(struct tty_struct *tty, struct file *filp) 137int riotopen(struct tty_struct *tty, struct file *filp)
138{ 138{
139 register uint SysPort; 139 unsigned int SysPort;
140 int Modem; 140 int Modem;
141 int repeat_this = 250; 141 int repeat_this = 250;
142 struct Port *PortP; /* pointer to the port structure */ 142 struct Port *PortP; /* pointer to the port structure */
@@ -155,7 +155,6 @@ int riotopen(struct tty_struct *tty, struct file *filp)
155 155
156 if (p->RIOFailed) { 156 if (p->RIOFailed) {
157 rio_dprintk(RIO_DEBUG_TTY, "System initialisation failed\n"); 157 rio_dprintk(RIO_DEBUG_TTY, "System initialisation failed\n");
158 pseterr(ENXIO);
159 func_exit(); 158 func_exit();
160 return -ENXIO; 159 return -ENXIO;
161 } 160 }
@@ -170,7 +169,6 @@ int riotopen(struct tty_struct *tty, struct file *filp)
170 */ 169 */
171 if (SysPort >= RIO_PORTS) { /* out of range ? */ 170 if (SysPort >= RIO_PORTS) { /* out of range ? */
172 rio_dprintk(RIO_DEBUG_TTY, "Illegal port number %d\n", SysPort); 171 rio_dprintk(RIO_DEBUG_TTY, "Illegal port number %d\n", SysPort);
173 pseterr(ENXIO);
174 func_exit(); 172 func_exit();
175 return -ENXIO; 173 return -ENXIO;
176 } 174 }
@@ -187,7 +185,6 @@ int riotopen(struct tty_struct *tty, struct file *filp)
187 */ 185 */
188 rio_dprintk(RIO_DEBUG_TTY, "port not mapped into system\n"); 186 rio_dprintk(RIO_DEBUG_TTY, "port not mapped into system\n");
189 func_exit(); 187 func_exit();
190 pseterr(ENXIO);
191 return -ENXIO; 188 return -ENXIO;
192 } 189 }
193 190
@@ -209,7 +206,6 @@ int riotopen(struct tty_struct *tty, struct file *filp)
209 */ 206 */
210 if ((PortP->HostP->Flags & RUN_STATE) != RC_RUNNING) { 207 if ((PortP->HostP->Flags & RUN_STATE) != RC_RUNNING) {
211 rio_dprintk(RIO_DEBUG_TTY, "Host not running\n"); 208 rio_dprintk(RIO_DEBUG_TTY, "Host not running\n");
212 pseterr(ENXIO);
213 func_exit(); 209 func_exit();
214 return -ENXIO; 210 return -ENXIO;
215 } 211 }
@@ -429,9 +425,6 @@ int riotopen(struct tty_struct *tty, struct file *filp)
429 425
430 rio_dprintk(RIO_DEBUG_TTY, "high level open done\n"); 426 rio_dprintk(RIO_DEBUG_TTY, "high level open done\n");
431 427
432#ifdef STATS
433 PortP->Stat.OpenCnt++;
434#endif
435 /* 428 /*
436 ** Count opens for port statistics reporting 429 ** Count opens for port statistics reporting
437 */ 430 */
@@ -466,10 +459,10 @@ int riotclose(void *ptr)
466 rio_dprintk(RIO_DEBUG_TTY, "port close SysPort %d\n", PortP->PortNum); 459 rio_dprintk(RIO_DEBUG_TTY, "port close SysPort %d\n", PortP->PortNum);
467 460
468 /* PortP = p->RIOPortp[SysPort]; */ 461 /* PortP = p->RIOPortp[SysPort]; */
469 rio_dprintk(RIO_DEBUG_TTY, "Port is at address 0x%x\n", (int) PortP); 462 rio_dprintk(RIO_DEBUG_TTY, "Port is at address 0x%p\n", PortP);
470 /* tp = PortP->TtyP; *//* Get tty */ 463 /* tp = PortP->TtyP; *//* Get tty */
471 tty = PortP->gs.tty; 464 tty = PortP->gs.tty;
472 rio_dprintk(RIO_DEBUG_TTY, "TTY is at address 0x%x\n", (int) tty); 465 rio_dprintk(RIO_DEBUG_TTY, "TTY is at address 0x%p\n", tty);
473 466
474 if (PortP->gs.closing_wait) 467 if (PortP->gs.closing_wait)
475 end_time = jiffies + PortP->gs.closing_wait; 468 end_time = jiffies + PortP->gs.closing_wait;
@@ -536,7 +529,6 @@ int riotclose(void *ptr)
536 529
537 if (!deleted) 530 if (!deleted)
538 while ((PortP->InUse != NOT_INUSE) && !p->RIOHalted && (PortP->TxBufferIn != PortP->TxBufferOut)) { 531 while ((PortP->InUse != NOT_INUSE) && !p->RIOHalted && (PortP->TxBufferIn != PortP->TxBufferOut)) {
539 cprintf("Need to flush the ttyport\n");
540 if (repeat_this-- <= 0) { 532 if (repeat_this-- <= 0) {
541 rv = -EINTR; 533 rv = -EINTR;
542 rio_dprintk(RIO_DEBUG_TTY, "Waiting for not idle closed broken by signal\n"); 534 rio_dprintk(RIO_DEBUG_TTY, "Waiting for not idle closed broken by signal\n");
@@ -615,9 +607,6 @@ int riotclose(void *ptr)
615*/ 607*/
616 PortP->Config &= ~(RIO_CTSFLOW | RIO_RTSFLOW); 608 PortP->Config &= ~(RIO_CTSFLOW | RIO_RTSFLOW);
617 609
618#ifdef STATS
619 PortP->Stat.CloseCnt++;
620#endif
621 /* 610 /*
622 ** Count opens for port statistics reporting 611 ** Count opens for port statistics reporting
623 */ 612 */
@@ -722,15 +711,15 @@ int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len
722 /* 711 /*
723 ** set the command byte and the argument byte 712 ** set the command byte and the argument byte
724 */ 713 */
725 WBYTE(PacketP->data[0], command); 714 writeb(command, &PacketP->data[0]);
726 715
727 if (len == 2) 716 if (len == 2)
728 WBYTE(PacketP->data[1], arg); 717 writeb(arg, &PacketP->data[1]);
729 718
730 /* 719 /*
731 ** set the length of the packet and set the command bit. 720 ** set the length of the packet and set the command bit.
732 */ 721 */
733 WBYTE(PacketP->len, PKT_CMD_BIT | len); 722 writeb(PKT_CMD_BIT | len, &PacketP->len);
734 723
735 add_transmit(PortP); 724 add_transmit(PortP);
736 /* 725 /*