From 1bd1501993bd0302b19e2440462d1180a0d6fed2 Mon Sep 17 00:00:00 2001 From: Benoit Goby Date: Wed, 19 Jan 2011 17:11:11 -0800 Subject: [PATCH] misc: ts27010: Don't wait for ack if DISC packet has been dropped Change-Id: Ia05e57e47df7642d1939f402bad8d7f2e5d29280 Signed-off-by: Benoit Goby --- drivers/misc/ts27010mux/ts27010_mux.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/misc/ts27010mux/ts27010_mux.c b/drivers/misc/ts27010mux/ts27010_mux.c index e302c60f2ef7..982728d967cf 100644 --- a/drivers/misc/ts27010mux/ts27010_mux.c +++ b/drivers/misc/ts27010mux/ts27010_mux.c @@ -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 != -- 2.34.1