misc: ts27010: Don't wait for ack if DISC packet has been dropped
authorBenoit Goby <benoit@android.com>
Thu, 20 Jan 2011 01:11:11 +0000 (17:11 -0800)
committerBenoit Goby <benoit@android.com>
Thu, 20 Jan 2011 01:40:19 +0000 (17:40 -0800)
Change-Id: Ia05e57e47df7642d1939f402bad8d7f2e5d29280
Signed-off-by: Benoit Goby <benoit@android.com>
drivers/misc/ts27010mux/ts27010_mux.c

index e302c60f2ef77f5baa132a94dde96c32244a361f..982728d967cf56d7697eb363006a6987fdaa9684 100644 (file)
@@ -379,7 +379,7 @@ static int ts0710_pkt_send(struct ts0710_con *ts0710, u8 *data)
        if (!ts27010mux_tty) {
                pr_warning("ts27010: ldisc closed.  discarding %d bytes\n",
                           TS0710_FRAME_SIZE(len));
-               return TS0710_FRAME_SIZE(len);
+               return -ENODEV;
        }
 
        res = ts27010_ldisc_send(ts27010mux_tty, data,
@@ -951,7 +951,10 @@ static int ts0710_close_channel(u8 dlci)
        /* Reducing retry to improve recovery times on BP panic/powercycle */
        try = 1;
        while (try--) {
-               ts27010_send_disc(ts0710, dlci);
+               retval = ts27010_send_disc(ts0710, dlci);
+               if (retval < 0)
+                       break;
+
                mutex_unlock(&d->lock);
                retval = wait_event_interruptible_timeout(d->close_wait,
                                                          d->state !=