This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / um / drivers / chan_kern.c
index 9e45a08..56e19fa 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/list.h>
 #include <linux/slab.h>
 #include <linux/tty.h>
+#include <linux/string.h>
 #include <linux/tty_flip.h>
 #include <asm/irq.h>
 #include "chan_kern.h"
@@ -265,6 +266,11 @@ static int one_chan_config_string(struct chan *chan, char *str, int size,
 {
        int n = 0;
 
+       if(chan == NULL){
+               CONFIG_CHUNK(str, size, n, "none", 1);
+               return(n);
+       }
+
        CONFIG_CHUNK(str, size, n, chan->ops->type, 0);
 
        if(chan->dev == NULL){
@@ -420,7 +426,8 @@ int parse_chan_pair(char *str, struct list_head *chans, int pri, int device,
                INIT_LIST_HEAD(chans);
        }
 
-       if((out = strchr(str, ',')) != NULL){
+       out = strchr(str, ',');
+       if(out != NULL){
                in = str;
                *out = '\0';
                out++;
@@ -475,12 +482,15 @@ void chan_interrupt(struct list_head *chans, struct work_struct *task,
                                goto out;
                        }
                        err = chan->ops->read(chan->fd, &c, chan->data);
-                       if(err > 0) tty_receive_char(tty, c);
+                       if(err > 0) 
+                               tty_receive_char(tty, c);
                } while(err > 0);
+
                if(err == 0) reactivate_fd(chan->fd, irq);
                if(err == -EIO){
                        if(chan->primary){
-                               if(tty != NULL) tty_hangup(tty);
+                               if(tty != NULL) 
+                                       tty_hangup(tty);
                                line_disable(dev, irq);
                                close_chan(chans);
                                free_chan(chans);