um: sorting out the chan mess, part 1
put references to in and out chans associated with line into explicit struct chan * fields in it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
c8e2876fc8
commit
ee4850702b
2 changed files with 5 additions and 0 deletions
|
@ -547,6 +547,7 @@ int parse_chan_pair(char *str, struct line *line, int device,
|
||||||
char *in, *out;
|
char *in, *out;
|
||||||
|
|
||||||
if (!list_empty(chans)) {
|
if (!list_empty(chans)) {
|
||||||
|
line->chan_in = line->chan_out = NULL;
|
||||||
free_chan(chans);
|
free_chan(chans);
|
||||||
INIT_LIST_HEAD(chans);
|
INIT_LIST_HEAD(chans);
|
||||||
}
|
}
|
||||||
|
@ -565,6 +566,7 @@ int parse_chan_pair(char *str, struct line *line, int device,
|
||||||
|
|
||||||
new->input = 1;
|
new->input = 1;
|
||||||
list_add(&new->list, chans);
|
list_add(&new->list, chans);
|
||||||
|
line->chan_in = new;
|
||||||
|
|
||||||
new = parse_chan(line, out, device, opts, error_out);
|
new = parse_chan(line, out, device, opts, error_out);
|
||||||
if (new == NULL)
|
if (new == NULL)
|
||||||
|
@ -572,6 +574,7 @@ int parse_chan_pair(char *str, struct line *line, int device,
|
||||||
|
|
||||||
list_add(&new->list, chans);
|
list_add(&new->list, chans);
|
||||||
new->output = 1;
|
new->output = 1;
|
||||||
|
line->chan_out = new;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
new = parse_chan(line, str, device, opts, error_out);
|
new = parse_chan(line, str, device, opts, error_out);
|
||||||
|
@ -581,6 +584,7 @@ int parse_chan_pair(char *str, struct line *line, int device,
|
||||||
list_add(&new->list, chans);
|
list_add(&new->list, chans);
|
||||||
new->input = 1;
|
new->input = 1;
|
||||||
new->output = 1;
|
new->output = 1;
|
||||||
|
line->chan_in = line->chan_out = new;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ struct line {
|
||||||
|
|
||||||
char *init_str;
|
char *init_str;
|
||||||
struct list_head chan_list;
|
struct list_head chan_list;
|
||||||
|
struct chan *chan_in, *chan_out;
|
||||||
|
|
||||||
/*This lock is actually, mostly, local to*/
|
/*This lock is actually, mostly, local to*/
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
|
|
Loading…
Add table
Reference in a new issue