git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.3
[linux-2.6.git]
/
drivers
/
tc
/
zs.c
diff --git
a/drivers/tc/zs.c
b/drivers/tc/zs.c
index
2904b0a
..
c5befc9
100644
(file)
--- a/
drivers/tc/zs.c
+++ b/
drivers/tc/zs.c
@@
-67,7
+67,7
@@
#include <asm/uaccess.h>
#include <asm/wbflush.h>
#include <asm/bootinfo.h>
#include <asm/uaccess.h>
#include <asm/wbflush.h>
#include <asm/bootinfo.h>
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_
MACH_
DECSTATION
#include <asm/dec/interrupts.h>
#include <asm/dec/machtype.h>
#include <asm/dec/tc.h>
#include <asm/dec/interrupts.h>
#include <asm/dec/machtype.h>
#include <asm/dec/tc.h>
@@
-111,7
+111,7
@@
struct zs_parms {
static struct zs_parms *zs_parms;
static struct zs_parms *zs_parms;
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_
MACH_
DECSTATION
static struct zs_parms ds_parms = {
scc0 : SCC0,
scc1 : SCC1,
static struct zs_parms ds_parms = {
scc0 : SCC0,
scc1 : SCC1,
@@
-132,7
+132,7
@@
static struct zs_parms baget_parms = {
};
#endif
};
#endif
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_
MACH_
DECSTATION
#define DS_BUS_PRESENT (IOASIC)
#else
#define DS_BUS_PRESENT 0
#define DS_BUS_PRESENT (IOASIC)
#else
#define DS_BUS_PRESENT 0
@@
-211,10
+211,6
@@
static void probe_sccs(void);
static void change_speed(struct dec_serial *info);
static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
static void change_speed(struct dec_serial *info);
static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
-
/*
* tmp_buf is used as a temporary buffer by serial_write. We need to
* lock it in case the copy_from_user blocks while swapping in a page,
/*
* tmp_buf is used as a temporary buffer by serial_write. We need to
* lock it in case the copy_from_user blocks while swapping in a page,
@@
-683,10
+679,7
@@
static void do_softint(void *private_)
return;
if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event)) {
return;
if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event)) {
- if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
- tty->ldisc.write_wakeup)
- (tty->ldisc.write_wakeup)(tty);
- wake_up_interruptible(&tty->write_wait);
+ tty_wakeup(tty);
}
}
}
}
@@
-706,7
+699,7
@@
int zs_startup(struct dec_serial * info)
save_flags(flags); cli();
#ifdef SERIAL_DEBUG_OPEN
save_flags(flags); cli();
#ifdef SERIAL_DEBUG_OPEN
- printk("starting up ttyS%
02
d (irq %d)...", info->line, info->irq);
+ printk("starting up ttyS%d (irq %d)...", info->line, info->irq);
#endif
/*
#endif
/*
@@
-950,16
+943,16
@@
static int rs_write(struct tty_struct * tty, int from_user,
save_flags(flags);
while (1) {
cli();
save_flags(flags);
while (1) {
cli();
- c =
MIN(count, MIN
(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
- SERIAL_XMIT_SIZE - info->xmit_head));
+ c =
min_t(int, count, min
(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
+
SERIAL_XMIT_SIZE - info->xmit_head));
if (c <= 0)
break;
if (from_user) {
down(&tmp_buf_sem);
copy_from_user(tmp_buf, buf, c);
if (c <= 0)
break;
if (from_user) {
down(&tmp_buf_sem);
copy_from_user(tmp_buf, buf, c);
- c =
MIN(c, MIN
(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
- SERIAL_XMIT_SIZE - info->xmit_head));
+ c =
min_t(int, c, min
(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
+
SERIAL_XMIT_SIZE - info->xmit_head));
memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c);
up(&tmp_buf_sem);
} else
memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c);
up(&tmp_buf_sem);
} else
@@
-1010,10
+1003,7
@@
static void rs_flush_buffer(struct tty_struct *tty)
cli();
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
sti();
cli();
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
sti();
- wake_up_interruptible(&tty->write_wait);
- if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
- tty->ldisc.write_wakeup)
- (tty->ldisc.write_wakeup)(tty);
+ tty_wakeup(tty);
}
/*
}
/*
@@
-1356,7
+1346,7
@@
static void rs_close(struct tty_struct *tty, struct file * filp)
}
#ifdef SERIAL_DEBUG_OPEN
}
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_close ttyS%
02
d, count = %d\n", info->line, info->count);
+ printk("rs_close ttyS%d, count = %d\n", info->line, info->count);
#endif
if ((tty->count == 1) && (info->count != 1)) {
/*
#endif
if ((tty->count == 1) && (info->count != 1)) {
/*
@@
-1371,7
+1361,7
@@
static void rs_close(struct tty_struct *tty, struct file * filp)
info->count = 1;
}
if (--info->count < 0) {
info->count = 1;
}
if (--info->count < 0) {
- printk("rs_close: bad serial port count for ttyS%
02
d: %d\n",
+ printk("rs_close: bad serial port count for ttyS%d: %d\n",
info->line, info->count);
info->count = 0;
}
info->line, info->count);
info->count = 0;
}
@@
-1407,8
+1397,7
@@
static void rs_close(struct tty_struct *tty, struct file * filp)
shutdown(info);
if (tty->driver->flush_buffer)
tty->driver->flush_buffer(tty);
shutdown(info);
if (tty->driver->flush_buffer)
tty->driver->flush_buffer(tty);
- if (tty->ldisc.flush_buffer)
- tty->ldisc.flush_buffer(tty);
+ tty_ldisc_flush(tty);
tty->closing = 0;
info->event = 0;
info->tty = 0;
tty->closing = 0;
info->event = 0;
info->tty = 0;
@@
-1446,7
+1435,7
@@
static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
if (char_time == 0)
char_time = 1;
if (timeout)
if (char_time == 0)
char_time = 1;
if (timeout)
- char_time =
MIN(
char_time, timeout);
+ char_time =
min_t(unsigned long,
char_time, timeout);
while ((read_zsreg(info->zs_channel, 1) & Tx_BUF_EMP) == 0) {
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(char_time);
while ((read_zsreg(info->zs_channel, 1) & Tx_BUF_EMP) == 0) {
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(char_time);
@@
-1531,7
+1520,7
@@
static int block_til_ready(struct tty_struct *tty, struct file * filp,
retval = 0;
add_wait_queue(&info->open_wait, &wait);
#ifdef SERIAL_DEBUG_OPEN
retval = 0;
add_wait_queue(&info->open_wait, &wait);
#ifdef SERIAL_DEBUG_OPEN
- printk("block_til_ready before block: ttyS%
02
d, count = %d\n",
+ printk("block_til_ready before block: ttyS%d, count = %d\n",
info->line, info->count);
#endif
cli();
info->line, info->count);
#endif
cli();
@@
-1565,7
+1554,7
@@
static int block_til_ready(struct tty_struct *tty, struct file * filp,
break;
}
#ifdef SERIAL_DEBUG_OPEN
break;
}
#ifdef SERIAL_DEBUG_OPEN
- printk("block_til_ready blocking: ttyS%
02
d, count = %d\n",
+ printk("block_til_ready blocking: ttyS%d, count = %d\n",
info->line, info->count);
#endif
schedule();
info->line, info->count);
#endif
schedule();
@@
-1576,7
+1565,7
@@
static int block_til_ready(struct tty_struct *tty, struct file * filp,
info->count++;
info->blocked_open--;
#ifdef SERIAL_DEBUG_OPEN
info->count++;
info->blocked_open--;
#ifdef SERIAL_DEBUG_OPEN
- printk("block_til_ready after blocking: ttyS%
02
d, count = %d\n",
+ printk("block_til_ready after blocking: ttyS%d, count = %d\n",
info->line, info->count);
#endif
if (retval)
info->line, info->count);
#endif
if (retval)
@@
-1689,7
+1678,7
@@
static void __init probe_sccs(void)
* system_base for this case :-(. HK
*/
switch(mips_machtype) {
* system_base for this case :-(. HK
*/
switch(mips_machtype) {
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_
MACH_
DECSTATION
case MACH_DS5000_2X0:
system_base = 0xbf800000;
n_chips = 2;
case MACH_DS5000_2X0:
system_base = 0xbf800000;
n_chips = 2;
@@
-1742,14
+1731,10
@@
static void __init probe_sccs(void)
* We're called early and memory managment isn't up, yet.
* Thus check_region would fail.
*/
* We're called early and memory managment isn't up, yet.
* Thus check_region would fail.
*/
- if (
check
_region((unsigned long)
+ if (
!request
_region((unsigned long)
zs_channels[n_channels].control,
zs_channels[n_channels].control,
- ZS_CHAN_IO_SIZE
) < 0) {
+ ZS_CHAN_IO_SIZE
, "SCC"))
panic("SCC I/O region is not free");
panic("SCC I/O region is not free");
- }
- request_region((unsigned long)
- zs_channels[n_channels].control,
- ZS_CHAN_IO_SIZE, "SCC");
#endif
zs_soft[n_channels].zs_channel = &zs_channels[n_channels];
zs_soft[n_channels].irq = zs_parms->irq;
#endif
zs_soft[n_channels].zs_channel = &zs_channels[n_channels];
zs_soft[n_channels].irq = zs_parms->irq;
@@
-1896,7
+1881,7
@@
int __init zs_init(void)
info->tqueue.data = info;
init_waitqueue_head(&info->open_wait);
init_waitqueue_head(&info->close_wait);
info->tqueue.data = info;
init_waitqueue_head(&info->open_wait);
init_waitqueue_head(&info->close_wait);
- printk("ttyS%
02d at 0x%08x (irq = %d)", info->line,
+ printk("ttyS%
d at 0x%08x (irq = %d)", info->line,
info->port, info->irq);
printk(" is a Z85C30 SCC\n");
tty_register_device(serial_driver, info->line, NULL);
info->port, info->irq);
printk(" is a Z85C30 SCC\n");
tty_register_device(serial_driver, info->line, NULL);