aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/chan_kern.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/drivers/chan_kern.c')
-rw-r--r--arch/um/drivers/chan_kern.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c
index 8b1262e9fb66..59c9b3f7c840 100644
--- a/arch/um/drivers/chan_kern.c
+++ b/arch/um/drivers/chan_kern.c
@@ -315,7 +315,7 @@ int console_open_chan(struct line *line, struct console *co,
315 return 0; 315 return 0;
316 316
317 if (0 != parse_chan_pair(line->init_str, &line->chan_list, 317 if (0 != parse_chan_pair(line->init_str, &line->chan_list,
318 line->init_pri, co->index, opts)) 318 co->index, opts))
319 return -1; 319 return -1;
320 if (0 != open_chan(&line->chan_list)) 320 if (0 != open_chan(&line->chan_list))
321 return -1; 321 return -1;
@@ -468,8 +468,7 @@ struct chan_type chan_table[] = {
468#endif 468#endif
469}; 469};
470 470
471static struct chan *parse_chan(char *str, int pri, int device, 471static struct chan *parse_chan(char *str, int device, struct chan_opts *opts)
472 struct chan_opts *opts)
473{ 472{
474 struct chan_type *entry; 473 struct chan_type *entry;
475 struct chan_ops *ops; 474 struct chan_ops *ops;
@@ -507,13 +506,12 @@ static struct chan *parse_chan(char *str, int pri, int device,
507 .output = 0, 506 .output = 0,
508 .opened = 0, 507 .opened = 0,
509 .fd = -1, 508 .fd = -1,
510 .pri = pri,
511 .ops = ops, 509 .ops = ops,
512 .data = data }); 510 .data = data });
513 return chan; 511 return chan;
514} 512}
515 513
516int parse_chan_pair(char *str, struct list_head *chans, int pri, int device, 514int parse_chan_pair(char *str, struct list_head *chans, int device,
517 struct chan_opts *opts) 515 struct chan_opts *opts)
518{ 516{
519 struct chan *new, *chan; 517 struct chan *new, *chan;
@@ -521,8 +519,6 @@ int parse_chan_pair(char *str, struct list_head *chans, int pri, int device,
521 519
522 if(!list_empty(chans)){ 520 if(!list_empty(chans)){
523 chan = list_entry(chans->next, struct chan, list); 521 chan = list_entry(chans->next, struct chan, list);
524 if(chan->pri >= pri)
525 return 0;
526 free_chan(chans); 522 free_chan(chans);
527 INIT_LIST_HEAD(chans); 523 INIT_LIST_HEAD(chans);
528 } 524 }
@@ -532,14 +528,14 @@ int parse_chan_pair(char *str, struct list_head *chans, int pri, int device,
532 in = str; 528 in = str;
533 *out = '\0'; 529 *out = '\0';
534 out++; 530 out++;
535 new = parse_chan(in, pri, device, opts); 531 new = parse_chan(in, device, opts);
536 if(new == NULL) 532 if(new == NULL)
537 return -1; 533 return -1;
538 534
539 new->input = 1; 535 new->input = 1;
540 list_add(&new->list, chans); 536 list_add(&new->list, chans);
541 537
542 new = parse_chan(out, pri, device, opts); 538 new = parse_chan(out, device, opts);
543 if(new == NULL) 539 if(new == NULL)
544 return -1; 540 return -1;
545 541
@@ -547,7 +543,7 @@ int parse_chan_pair(char *str, struct list_head *chans, int pri, int device,
547 new->output = 1; 543 new->output = 1;
548 } 544 }
549 else { 545 else {
550 new = parse_chan(str, pri, device, opts); 546 new = parse_chan(str, device, opts);
551 if(new == NULL) 547 if(new == NULL)
552 return -1; 548 return -1;
553 549