msm: sdio_cmux: Abort TX when sdio_write failed with -ENODEV

When sdio_write fails with a return value of -ENODEV, it has got
into an unrecoverable error state. So abort the transmission and
hence avoid flooding the kernel logs with error messages.

Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
diff --git a/arch/arm/mach-msm/sdio_cmux.c b/arch/arm/mach-msm/sdio_cmux.c
index 2965fc9..d97870a 100644
--- a/arch/arm/mach-msm/sdio_cmux.c
+++ b/arch/arm/mach-msm/sdio_cmux.c
@@ -679,6 +679,7 @@
 			while (!(abort_tx) &&
 				((r = sdio_write(sdio_qmi_chl,
 						write_data, write_size)) < 0)
+				&& (r != -ENODEV)
 				&& (write_retry++ < MAX_WRITE_RETRY)) {
 				mutex_unlock(&modem_reset_lock);
 				pr_err("%s: sdio_write failed with rc %d."
@@ -690,6 +691,11 @@
 				D("%s: sdio_write_completed %dbytes\n",
 				  __func__, write_size);
 				bytes_written += write_size;
+			} else if (r == -ENODEV) {
+				pr_err("%s: aborting_tx because sdio_write"
+				       " returned %d\n", __func__, r);
+				r = 0;
+				abort_tx = 1;
 			}
 			mutex_unlock(&modem_reset_lock);
 			kfree(list_elem->cmux_pkt.hdr);