diff options
Diffstat (limited to 'drivers/char/hvsi.c')
-rw-r--r-- | drivers/char/hvsi.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c index a89a95fb5e40..d7806834fc17 100644 --- a/drivers/char/hvsi.c +++ b/drivers/char/hvsi.c | |||
@@ -69,7 +69,7 @@ | |||
69 | #define __ALIGNED__ __attribute__((__aligned__(sizeof(long)))) | 69 | #define __ALIGNED__ __attribute__((__aligned__(sizeof(long)))) |
70 | 70 | ||
71 | struct hvsi_struct { | 71 | struct hvsi_struct { |
72 | struct work_struct writer; | 72 | struct delayed_work writer; |
73 | struct work_struct handshaker; | 73 | struct work_struct handshaker; |
74 | wait_queue_head_t emptyq; /* woken when outbuf is emptied */ | 74 | wait_queue_head_t emptyq; /* woken when outbuf is emptied */ |
75 | wait_queue_head_t stateq; /* woken when HVSI state changes */ | 75 | wait_queue_head_t stateq; /* woken when HVSI state changes */ |
@@ -406,7 +406,7 @@ static void hvsi_insert_chars(struct hvsi_struct *hp, const char *buf, int len) | |||
406 | hp->sysrq = 1; | 406 | hp->sysrq = 1; |
407 | continue; | 407 | continue; |
408 | } else if (hp->sysrq) { | 408 | } else if (hp->sysrq) { |
409 | handle_sysrq(c, NULL, hp->tty); | 409 | handle_sysrq(c, hp->tty); |
410 | hp->sysrq = 0; | 410 | hp->sysrq = 0; |
411 | continue; | 411 | continue; |
412 | } | 412 | } |
@@ -555,7 +555,7 @@ static void hvsi_send_overflow(struct hvsi_struct *hp) | |||
555 | * must get all pending data because we only get an irq on empty->non-empty | 555 | * must get all pending data because we only get an irq on empty->non-empty |
556 | * transition | 556 | * transition |
557 | */ | 557 | */ |
558 | static irqreturn_t hvsi_interrupt(int irq, void *arg, struct pt_regs *regs) | 558 | static irqreturn_t hvsi_interrupt(int irq, void *arg) |
559 | { | 559 | { |
560 | struct hvsi_struct *hp = (struct hvsi_struct *)arg; | 560 | struct hvsi_struct *hp = (struct hvsi_struct *)arg; |
561 | struct tty_struct *flip; | 561 | struct tty_struct *flip; |
@@ -616,7 +616,7 @@ static int __init poll_for_state(struct hvsi_struct *hp, int state) | |||
616 | unsigned long end_jiffies = jiffies + HVSI_TIMEOUT; | 616 | unsigned long end_jiffies = jiffies + HVSI_TIMEOUT; |
617 | 617 | ||
618 | for (;;) { | 618 | for (;;) { |
619 | hvsi_interrupt(hp->virq, (void *)hp, NULL); /* get pending data */ | 619 | hvsi_interrupt(hp->virq, (void *)hp); /* get pending data */ |
620 | 620 | ||
621 | if (hp->state == state) | 621 | if (hp->state == state) |
622 | return 0; | 622 | return 0; |
@@ -744,9 +744,10 @@ static int hvsi_handshake(struct hvsi_struct *hp) | |||
744 | return 0; | 744 | return 0; |
745 | } | 745 | } |
746 | 746 | ||
747 | static void hvsi_handshaker(void *arg) | 747 | static void hvsi_handshaker(struct work_struct *work) |
748 | { | 748 | { |
749 | struct hvsi_struct *hp = (struct hvsi_struct *)arg; | 749 | struct hvsi_struct *hp = |
750 | container_of(work, struct hvsi_struct, handshaker); | ||
750 | 751 | ||
751 | if (hvsi_handshake(hp) >= 0) | 752 | if (hvsi_handshake(hp) >= 0) |
752 | return; | 753 | return; |
@@ -951,9 +952,10 @@ static void hvsi_push(struct hvsi_struct *hp) | |||
951 | } | 952 | } |
952 | 953 | ||
953 | /* hvsi_write_worker will keep rescheduling itself until outbuf is empty */ | 954 | /* hvsi_write_worker will keep rescheduling itself until outbuf is empty */ |
954 | static void hvsi_write_worker(void *arg) | 955 | static void hvsi_write_worker(struct work_struct *work) |
955 | { | 956 | { |
956 | struct hvsi_struct *hp = (struct hvsi_struct *)arg; | 957 | struct hvsi_struct *hp = |
958 | container_of(work, struct hvsi_struct, writer.work); | ||
957 | unsigned long flags; | 959 | unsigned long flags; |
958 | #ifdef DEBUG | 960 | #ifdef DEBUG |
959 | static long start_j = 0; | 961 | static long start_j = 0; |
@@ -1130,7 +1132,7 @@ static int hvsi_tiocmset(struct tty_struct *tty, struct file *file, | |||
1130 | } | 1132 | } |
1131 | 1133 | ||
1132 | 1134 | ||
1133 | static struct tty_operations hvsi_ops = { | 1135 | static const struct tty_operations hvsi_ops = { |
1134 | .open = hvsi_open, | 1136 | .open = hvsi_open, |
1135 | .close = hvsi_close, | 1137 | .close = hvsi_close, |
1136 | .write = hvsi_write, | 1138 | .write = hvsi_write, |
@@ -1159,6 +1161,8 @@ static int __init hvsi_init(void) | |||
1159 | hvsi_driver->type = TTY_DRIVER_TYPE_SYSTEM; | 1161 | hvsi_driver->type = TTY_DRIVER_TYPE_SYSTEM; |
1160 | hvsi_driver->init_termios = tty_std_termios; | 1162 | hvsi_driver->init_termios = tty_std_termios; |
1161 | hvsi_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL; | 1163 | hvsi_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL; |
1164 | hvsi_driver->init_termios.c_ispeed = 9600; | ||
1165 | hvsi_driver->init_termios.c_ospeed = 9600; | ||
1162 | hvsi_driver->flags = TTY_DRIVER_REAL_RAW; | 1166 | hvsi_driver->flags = TTY_DRIVER_REAL_RAW; |
1163 | tty_set_operations(hvsi_driver, &hvsi_ops); | 1167 | tty_set_operations(hvsi_driver, &hvsi_ops); |
1164 | 1168 | ||
@@ -1287,8 +1291,8 @@ static int __init hvsi_console_init(void) | |||
1287 | } | 1291 | } |
1288 | 1292 | ||
1289 | hp = &hvsi_ports[hvsi_count]; | 1293 | hp = &hvsi_ports[hvsi_count]; |
1290 | INIT_WORK(&hp->writer, hvsi_write_worker, hp); | 1294 | INIT_DELAYED_WORK(&hp->writer, hvsi_write_worker); |
1291 | INIT_WORK(&hp->handshaker, hvsi_handshaker, hp); | 1295 | INIT_WORK(&hp->handshaker, hvsi_handshaker); |
1292 | init_waitqueue_head(&hp->emptyq); | 1296 | init_waitqueue_head(&hp->emptyq); |
1293 | init_waitqueue_head(&hp->stateq); | 1297 | init_waitqueue_head(&hp->stateq); |
1294 | spin_lock_init(&hp->lock); | 1298 | spin_lock_init(&hp->lock); |