diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-09-10 08:39:18 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2012-03-24 19:29:54 -0400 |
commit | 10c890c0a303070652f5374ea31a0b29350d14d9 (patch) | |
tree | 34077d8fb7d8d81d761f2c28021310ce821f4ceb /arch/um/drivers | |
parent | 0fcd719934cd3521ae4a977f454e75e2be60b7ff (diff) |
um: switch close_chan() to struct line
... and switch chan_interrupt() to directly calling close_one_chan(),
so we can lose delay_free_irq argument of close_chan() as well.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/drivers')
-rw-r--r-- | arch/um/drivers/chan.h | 2 | ||||
-rw-r--r-- | arch/um/drivers/chan_kern.c | 16 | ||||
-rw-r--r-- | arch/um/drivers/line.c | 2 |
3 files changed, 11 insertions, 9 deletions
diff --git a/arch/um/drivers/chan.h b/arch/um/drivers/chan.h index d3974a91aa48..02b5a76e98d9 100644 --- a/arch/um/drivers/chan.h +++ b/arch/um/drivers/chan.h | |||
@@ -40,7 +40,7 @@ extern void deactivate_chan(struct chan *chan, int irq); | |||
40 | extern void reactivate_chan(struct chan *chan, int irq); | 40 | extern void reactivate_chan(struct chan *chan, int irq); |
41 | extern void chan_enable_winch(struct chan *chan, struct tty_struct *tty); | 41 | extern void chan_enable_winch(struct chan *chan, struct tty_struct *tty); |
42 | extern int enable_chan(struct line *line); | 42 | extern int enable_chan(struct line *line); |
43 | extern void close_chan(struct list_head *chans, int delay_free_irq); | 43 | extern void close_chan(struct line *line); |
44 | extern int chan_window_size(struct line *line, | 44 | extern int chan_window_size(struct line *line, |
45 | unsigned short *rows_out, | 45 | unsigned short *rows_out, |
46 | unsigned short *cols_out); | 46 | unsigned short *cols_out); |
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index 4744b5840fa9..ca4c7ebfd0aa 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c | |||
@@ -185,7 +185,7 @@ int enable_chan(struct line *line) | |||
185 | return 0; | 185 | return 0; |
186 | 186 | ||
187 | out_close: | 187 | out_close: |
188 | close_chan(&line->chan_list, 0); | 188 | close_chan(line); |
189 | return err; | 189 | return err; |
190 | } | 190 | } |
191 | 191 | ||
@@ -246,7 +246,7 @@ static void close_one_chan(struct chan *chan, int delay_free_irq) | |||
246 | chan->fd = -1; | 246 | chan->fd = -1; |
247 | } | 247 | } |
248 | 248 | ||
249 | void close_chan(struct list_head *chans, int delay_free_irq) | 249 | void close_chan(struct line *line) |
250 | { | 250 | { |
251 | struct chan *chan; | 251 | struct chan *chan; |
252 | 252 | ||
@@ -255,8 +255,8 @@ void close_chan(struct list_head *chans, int delay_free_irq) | |||
255 | * state. Then, the first one opened will have the original state, | 255 | * state. Then, the first one opened will have the original state, |
256 | * so it must be the last closed. | 256 | * so it must be the last closed. |
257 | */ | 257 | */ |
258 | list_for_each_entry_reverse(chan, chans, list) { | 258 | list_for_each_entry_reverse(chan, &line->chan_list, list) { |
259 | close_one_chan(chan, delay_free_irq); | 259 | close_one_chan(chan, 0); |
260 | } | 260 | } |
261 | } | 261 | } |
262 | 262 | ||
@@ -587,10 +587,12 @@ void chan_interrupt(struct line *line, struct tty_struct *tty, int irq) | |||
587 | if (chan->primary) { | 587 | if (chan->primary) { |
588 | if (tty != NULL) | 588 | if (tty != NULL) |
589 | tty_hangup(tty); | 589 | tty_hangup(tty); |
590 | close_chan(&line->chan_list, 1); | 590 | if (line->chan_out != chan) |
591 | return; | 591 | close_one_chan(line->chan_out, 1); |
592 | } | 592 | } |
593 | else close_one_chan(chan, 1); | 593 | close_one_chan(chan, 1); |
594 | if (chan->primary) | ||
595 | return; | ||
594 | } | 596 | } |
595 | out: | 597 | out: |
596 | if (tty) | 598 | if (tty) |
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 9299b8a2d171..4a3c853689a3 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c | |||
@@ -465,7 +465,7 @@ void close_lines(struct line *lines, int nlines) | |||
465 | int i; | 465 | int i; |
466 | 466 | ||
467 | for(i = 0; i < nlines; i++) | 467 | for(i = 0; i < nlines; i++) |
468 | close_chan(&lines[i].chan_list, 0); | 468 | close_chan(&lines[i]); |
469 | } | 469 | } |
470 | 470 | ||
471 | int setup_one_line(struct line *lines, int n, char *init, | 471 | int setup_one_line(struct line *lines, int n, char *init, |