summaryrefslogtreecommitdiff
path: root/drivers/staging/cg2900/bluetooth/cg2900_uart.c
diff options
context:
space:
mode:
authorHemant Gupta <hemant.gupta@stericsson.com>2011-09-27 18:46:46 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:05:55 +0200
commit875892f0735c1ffb789c705e86824ae09824c30a (patch)
tree5dd8ecb57ccb3002518bb5682a1ce83b5816caf6 /drivers/staging/cg2900/bluetooth/cg2900_uart.c
parent33dd0f1a76ae8a8abe5061fc18cdc609d14a4fff (diff)
mfd/cg2900: Error opening HCI Raw Channel
This patch fixes the corner case issue in driver, due to which if the port is closed while data is being read, the driver state is not correct next time the port is re-opened. ST-Ericsson Linux next: Not tested, ER356425 ST-Ericsson ID: 356425 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I82090c25ce7dd3aea07bacd96856d62361bcd741 Signed-off-by: Hemant Gupta <hemant.gupta@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32208 Reviewed-by: Henrik POSSUNG <henrik.possung@stericsson.com> Reviewed-by: Par-Gunnar HJALMDAHL <par-gunnar.p.hjalmdahl@stericsson.com>
Diffstat (limited to 'drivers/staging/cg2900/bluetooth/cg2900_uart.c')
-rw-r--r--drivers/staging/cg2900/bluetooth/cg2900_uart.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/staging/cg2900/bluetooth/cg2900_uart.c b/drivers/staging/cg2900/bluetooth/cg2900_uart.c
index fb175309685..5b6cd0feeae 100644
--- a/drivers/staging/cg2900/bluetooth/cg2900_uart.c
+++ b/drivers/staging/cg2900/bluetooth/cg2900_uart.c
@@ -1395,6 +1395,16 @@ static void uart_set_chip_power(struct cg2900_chip_dev *dev, bool chip_on)
"New sleep_state: CHIP_POWERED_DOWN\n");
uart_info->sleep_state = CHIP_POWERED_DOWN;
}
+
+ /*
+ * Reset the uart_info state so that
+ * next packet can be handled
+ * correctly by driver.
+ */
+ uart_info->rx_state = W4_PACKET_TYPE;
+ uart_info->rx_count = 0;
+ kfree_skb(uart_info->rx_skb);
+ uart_info->rx_skb = NULL;
cg2900_disable_regulator(uart_info);
/*
* Setting baud rate to 0 will tell UART driver to shut off its