Bluetooth: btusb: btusb_intel_cmd_timeout: use sleeping functions
authorRajat Jain <rajatja@google.com>
Mon, 28 Jan 2019 23:08:09 +0000 (15:08 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 29 Jan 2019 15:03:24 +0000 (16:03 +0100)
The btusb_intel_cmd_timeout() is called from workqueue contexts,
so use the helper functions that can sleep.

Signed-off-by: Rajat Jain <rajatja@google.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btusb.c

index 5de0c2e..9a890b2 100644 (file)
@@ -523,9 +523,9 @@ static void btusb_intel_cmd_timeout(struct hci_dev *hdev)
        }
 
        bt_dev_err(hdev, "Initiating HW reset via gpio");
-       gpiod_set_value(reset_gpio, 1);
-       mdelay(100);
-       gpiod_set_value(reset_gpio, 0);
+       gpiod_set_value_cansleep(reset_gpio, 1);
+       msleep(100);
+       gpiod_set_value_cansleep(reset_gpio, 0);
 }
 
 static inline void btusb_free_frags(struct btusb_data *data)