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>
This commit is contained in:
parent
0fcd719934
commit
10c890c0a3
@ -40,7 +40,7 @@ extern void deactivate_chan(struct chan *chan, int irq);
|
|||||||
extern void reactivate_chan(struct chan *chan, int irq);
|
extern void reactivate_chan(struct chan *chan, int irq);
|
||||||
extern void chan_enable_winch(struct chan *chan, struct tty_struct *tty);
|
extern void chan_enable_winch(struct chan *chan, struct tty_struct *tty);
|
||||||
extern int enable_chan(struct line *line);
|
extern int enable_chan(struct line *line);
|
||||||
extern void close_chan(struct list_head *chans, int delay_free_irq);
|
extern void close_chan(struct line *line);
|
||||||
extern int chan_window_size(struct line *line,
|
extern int chan_window_size(struct line *line,
|
||||||
unsigned short *rows_out,
|
unsigned short *rows_out,
|
||||||
unsigned short *cols_out);
|
unsigned short *cols_out);
|
||||||
|
@ -185,7 +185,7 @@ int enable_chan(struct line *line)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_close:
|
out_close:
|
||||||
close_chan(&line->chan_list, 0);
|
close_chan(line);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,7 +246,7 @@ static void close_one_chan(struct chan *chan, int delay_free_irq)
|
|||||||
chan->fd = -1;
|
chan->fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void close_chan(struct list_head *chans, int delay_free_irq)
|
void close_chan(struct line *line)
|
||||||
{
|
{
|
||||||
struct chan *chan;
|
struct chan *chan;
|
||||||
|
|
||||||
@ -255,8 +255,8 @@ void close_chan(struct list_head *chans, int delay_free_irq)
|
|||||||
* state. Then, the first one opened will have the original state,
|
* state. Then, the first one opened will have the original state,
|
||||||
* so it must be the last closed.
|
* so it must be the last closed.
|
||||||
*/
|
*/
|
||||||
list_for_each_entry_reverse(chan, chans, list) {
|
list_for_each_entry_reverse(chan, &line->chan_list, list) {
|
||||||
close_one_chan(chan, delay_free_irq);
|
close_one_chan(chan, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -587,10 +587,12 @@ void chan_interrupt(struct line *line, struct tty_struct *tty, int irq)
|
|||||||
if (chan->primary) {
|
if (chan->primary) {
|
||||||
if (tty != NULL)
|
if (tty != NULL)
|
||||||
tty_hangup(tty);
|
tty_hangup(tty);
|
||||||
close_chan(&line->chan_list, 1);
|
if (line->chan_out != chan)
|
||||||
return;
|
close_one_chan(line->chan_out, 1);
|
||||||
}
|
}
|
||||||
else close_one_chan(chan, 1);
|
close_one_chan(chan, 1);
|
||||||
|
if (chan->primary)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
if (tty)
|
if (tty)
|
||||||
|
@ -465,7 +465,7 @@ void close_lines(struct line *lines, int nlines)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i = 0; i < nlines; i++)
|
for(i = 0; i < nlines; i++)
|
||||||
close_chan(&lines[i].chan_list, 0);
|
close_chan(&lines[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
int setup_one_line(struct line *lines, int n, char *init,
|
int setup_one_line(struct line *lines, int n, char *init,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user