]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/char/n_gsm.c
Merge branch 'mrst-touchscreen' into next
[mv-sheeva.git] / drivers / char / n_gsm.c
index c4161d5e053d383c74d79905dfdb8d3fef27868e..04ef3ef0a422c5b6fae1e39284bb8e174d6a9dac 100644 (file)
@@ -43,7 +43,6 @@
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/tty.h>
-#include <linux/timer.h>
 #include <linux/ctype.h>
 #include <linux/mm.h>
 #include <linux/string.h>
@@ -904,9 +903,7 @@ static void gsm_dlci_data_sweep(struct gsm_mux *gsm)
        int len;
        /* Priority ordering: We should do priority with RR of the groups */
        int i = 1;
-       unsigned long flags;
 
-       spin_lock_irqsave(&gsm->tx_lock, flags);
        while (i < NUM_DLCI) {
                struct gsm_dlci *dlci;
 
@@ -922,12 +919,11 @@ static void gsm_dlci_data_sweep(struct gsm_mux *gsm)
                else
                        len = gsm_dlci_data_output_framed(gsm, dlci);
                if (len < 0)
-                       return;
+                       break;
                /* DLCI empty - try the next */
                if (len == 0)
                        i++;
        }
-       spin_unlock_irqrestore(&gsm->tx_lock, flags);
 }
 
 /**
@@ -2230,12 +2226,16 @@ static int gsmld_open(struct tty_struct *tty)
 static void gsmld_write_wakeup(struct tty_struct *tty)
 {
        struct gsm_mux *gsm = tty->disc_data;
+       unsigned long flags;
 
        /* Queue poll */
        clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
        gsm_data_kick(gsm);
-       if (gsm->tx_bytes < TX_THRESH_LO)
+       if (gsm->tx_bytes < TX_THRESH_LO) {
+               spin_lock_irqsave(&gsm->tx_lock, flags);
                gsm_dlci_data_sweep(gsm);
+               spin_unlock_irqrestore(&gsm->tx_lock, flags);
+       }
 }
 
 /**