]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/char/moxa.c
ft232: support the ASYNC_LOW_LATENCY flag
[karo-tx-linux.git] / drivers / char / moxa.c
index 8b0da97d5293b58f09b267131455e714b5d8344c..4a4cab73d0be176aa640c9717bc7582231b39495 100644 (file)
@@ -1486,11 +1486,11 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
        }
 
        if (!handle) /* nothing else to do */
-               return 0;
+               goto put;
 
        intr = readw(ip); /* port irq status */
        if (intr == 0)
-               return 0;
+               goto put;
 
        writew(0, ip); /* ACK port */
        ofsAddr = p->tableAddr;
@@ -1499,16 +1499,17 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
                                ofsAddr + HostStat);
 
        if (!inited)
-               return 0;
+               goto put;
 
        if (tty && (intr & IntrBreak) && !I_IGNBRK(tty)) { /* BREAK */
                tty_insert_flip_char(tty, 0, TTY_BREAK);
                tty_schedule_flip(tty);
        }
-       tty_kref_put(tty);
 
        if (intr & IntrLine)
                moxa_new_dcdstate(p, readb(ofsAddr + FlagStat) & DCD_state);
+put:
+       tty_kref_put(tty);
 
        return 0;
 }