X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fsbus%2Fchar%2Faurora.c;h=a433252a5ff28cfd5151907d4e7ac345d3e9edae;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=1ff81bec87417b006ba1f3682b56762df88ac37d;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/drivers/sbus/char/aurora.c b/drivers/sbus/char/aurora.c index 1ff81bec8..a433252a5 100644 --- a/drivers/sbus/char/aurora.c +++ b/drivers/sbus/char/aurora.c @@ -60,12 +60,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -1550,7 +1550,7 @@ static void aurora_close(struct tty_struct * tty, struct file * filp) #endif } -static int aurora_write(struct tty_struct * tty, int from_user, +static int aurora_write(struct tty_struct * tty, const unsigned char *buf, int count) { struct Aurora_port *port = (struct Aurora_port *) tty->driver_data; @@ -1573,51 +1573,22 @@ static int aurora_write(struct tty_struct * tty, int from_user, return 0; save_flags(flags); - if (from_user) { - down(&tmp_buf_sem); - while (1) { - c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, - SERIAL_XMIT_SIZE - port->xmit_head)); - if (c <= 0) - break; - - c -= copy_from_user(tmp_buf, buf, c); - if (!c) { - if (!total) - total = -EFAULT; - break; - } - cli(); - c = MIN(c, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, - SERIAL_XMIT_SIZE - port->xmit_head)); - memcpy(port->xmit_buf + port->xmit_head, tmp_buf, c); - port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1); - port->xmit_cnt += c; + while (1) { + cli(); + c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, + SERIAL_XMIT_SIZE - port->xmit_head)); + if (c <= 0) { restore_flags(flags); - - buf += c; - count -= c; - total += c; + break; } - up(&tmp_buf_sem); - } else { - while (1) { - cli(); - c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, - SERIAL_XMIT_SIZE - port->xmit_head)); - if (c <= 0) { - restore_flags(flags); - break; - } - memcpy(port->xmit_buf + port->xmit_head, buf, c); - port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1); - port->xmit_cnt += c; - restore_flags(flags); + memcpy(port->xmit_buf + port->xmit_head, buf, c); + port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1); + port->xmit_cnt += c; + restore_flags(flags); - buf += c; - count -= c; - total += c; - } + buf += c; + count -= c; + total += c; } cli(); @@ -2368,10 +2339,10 @@ int irq = 0; int irq1 = 0; int irq2 = 0; int irq3 = 0; -MODULE_PARM(irq , "i"); -MODULE_PARM(irq1, "i"); -MODULE_PARM(irq2, "i"); -MODULE_PARM(irq3, "i"); +module_param(irq , int, 0); +module_param(irq1, int, 0); +module_param(irq2, int, 0); +module_param(irq3, int, 0); static int __init aurora_init(void) {