diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-03-24 03:18:27 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-24 07:33:29 -0800 |
commit | e2b3afd676ad3e15ca2efca3b3605c7d817ec6e3 (patch) | |
tree | f6b7c9739e20a865b6f1f379ccbab67a63ddec53 /drivers/char/rio/riotty.c | |
parent | 27c6e526f34760a9c48a90112242b7165064fa85 (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.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/char/rio/riotty.c b/drivers/char/rio/riotty.c index 6379816ed17..0ca431b4c47 100644 --- a/drivers/char/rio/riotty.c +++ b/drivers/char/rio/riotty.c @@ -136,7 +136,7 @@ extern struct rio_info *p; int riotopen(struct tty_struct *tty, struct file *filp) { - register uint SysPort; + unsigned int SysPort; int Modem; int repeat_this = 250; struct Port *PortP; /* pointer to the port structure */ @@ -155,7 +155,6 @@ int riotopen(struct tty_struct *tty, struct file *filp) if (p->RIOFailed) { rio_dprintk(RIO_DEBUG_TTY, "System initialisation failed\n"); - pseterr(ENXIO); func_exit(); return -ENXIO; } @@ -170,7 +169,6 @@ int riotopen(struct tty_struct *tty, struct file *filp) */ if (SysPort >= RIO_PORTS) { /* out of range ? */ rio_dprintk(RIO_DEBUG_TTY, "Illegal port number %d\n", SysPort); - pseterr(ENXIO); func_exit(); return -ENXIO; } @@ -187,7 +185,6 @@ int riotopen(struct tty_struct *tty, struct file *filp) */ rio_dprintk(RIO_DEBUG_TTY, "port not mapped into system\n"); func_exit(); - pseterr(ENXIO); return -ENXIO; } @@ -209,7 +206,6 @@ int riotopen(struct tty_struct *tty, struct file *filp) */ if ((PortP->HostP->Flags & RUN_STATE) != RC_RUNNING) { rio_dprintk(RIO_DEBUG_TTY, "Host not running\n"); - pseterr(ENXIO); func_exit(); return -ENXIO; } @@ -429,9 +425,6 @@ int riotopen(struct tty_struct *tty, struct file *filp) rio_dprintk(RIO_DEBUG_TTY, "high level open done\n"); -#ifdef STATS - PortP->Stat.OpenCnt++; -#endif /* ** Count opens for port statistics reporting */ @@ -466,10 +459,10 @@ int riotclose(void *ptr) rio_dprintk(RIO_DEBUG_TTY, "port close SysPort %d\n", PortP->PortNum); /* PortP = p->RIOPortp[SysPort]; */ - rio_dprintk(RIO_DEBUG_TTY, "Port is at address 0x%x\n", (int) PortP); + rio_dprintk(RIO_DEBUG_TTY, "Port is at address 0x%p\n", PortP); /* tp = PortP->TtyP; *//* Get tty */ tty = PortP->gs.tty; - rio_dprintk(RIO_DEBUG_TTY, "TTY is at address 0x%x\n", (int) tty); + rio_dprintk(RIO_DEBUG_TTY, "TTY is at address 0x%p\n", tty); if (PortP->gs.closing_wait) end_time = jiffies + PortP->gs.closing_wait; @@ -536,7 +529,6 @@ int riotclose(void *ptr) if (!deleted) while ((PortP->InUse != NOT_INUSE) && !p->RIOHalted && (PortP->TxBufferIn != PortP->TxBufferOut)) { - cprintf("Need to flush the ttyport\n"); if (repeat_this-- <= 0) { rv = -EINTR; rio_dprintk(RIO_DEBUG_TTY, "Waiting for not idle closed broken by signal\n"); @@ -615,9 +607,6 @@ int riotclose(void *ptr) */ PortP->Config &= ~(RIO_CTSFLOW | RIO_RTSFLOW); -#ifdef STATS - PortP->Stat.CloseCnt++; -#endif /* ** Count opens for port statistics reporting */ @@ -722,15 +711,15 @@ int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len /* ** set the command byte and the argument byte */ - WBYTE(PacketP->data[0], command); + writeb(command, &PacketP->data[0]); if (len == 2) - WBYTE(PacketP->data[1], arg); + writeb(arg, &PacketP->data[1]); /* ** set the length of the packet and set the command bit. */ - WBYTE(PacketP->len, PKT_CMD_BIT | len); + writeb(PKT_CMD_BIT | len, &PacketP->len); add_transmit(PortP); /* |