From 7b4b8740c6fc153fbb24b3c1ac391cf8908ad113 Mon Sep 17 00:00:00 2001 From: Amitkumar Karwar Date: Thu, 1 Jan 2015 00:13:41 -0800 Subject: Bluetooth: btmrvl: add surprise_removed flag This flag will be set in unload path to make sure that we skip sending further commands, ignore interrupts and stop main thread when unload starts. Signed-off-by: Amitkumar Karwar Signed-off-by: Marcel Holtmann --- drivers/bluetooth/btmrvl_sdio.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/bluetooth/btmrvl_sdio.c') diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c index 0057c0b7a776..80ec2008bd7c 100644 --- a/drivers/bluetooth/btmrvl_sdio.c +++ b/drivers/bluetooth/btmrvl_sdio.c @@ -798,6 +798,9 @@ static void btmrvl_sdio_interrupt(struct sdio_func *func) priv = card->priv; + if (priv->surprise_removed) + return; + if (card->reg->int_read_to_clear) ret = btmrvl_sdio_read_to_clear(card, &ireg); else @@ -1466,6 +1469,7 @@ static void btmrvl_sdio_remove(struct sdio_func *func) btmrvl_sdio_disable_host_int(card); } BT_DBG("unregester dev"); + card->priv->surprise_removed = true; btmrvl_sdio_unregister_dev(card); btmrvl_remove_card(card->priv); } -- cgit v1.2.3