diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2015-02-14 02:33:35 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-02-14 16:25:09 -0500 |
commit | 129a76931a6e90ddca586ba6e4292b5b429488bc (patch) | |
tree | bd3b00b11c2ee5e66f698fe995f055fbe2f5d90e /drivers/bluetooth/btusb.c | |
parent | faa810303d4141de335a8b29ec7fba8d653903fc (diff) |
Bluetooth: btusb: Remove unneeded btusb_wait_on_bit_timeout()
There's now a proper wait_on_bit_timeout() API in linux/wait.h so we can
remove our own copy from btusb.c. Our copy had the task state and
timeout variables swapped so the patch also changes their order.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/btusb.c')
-rw-r--r-- | drivers/bluetooth/btusb.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index b87688881143..0e5158eaec6c 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -338,16 +338,6 @@ struct btusb_data { | |||
338 | int (*recv_bulk)(struct btusb_data *data, void *buffer, int count); | 338 | int (*recv_bulk)(struct btusb_data *data, void *buffer, int count); |
339 | }; | 339 | }; |
340 | 340 | ||
341 | static int btusb_wait_on_bit_timeout(void *word, int bit, unsigned long timeout, | ||
342 | unsigned mode) | ||
343 | { | ||
344 | might_sleep(); | ||
345 | if (!test_bit(bit, word)) | ||
346 | return 0; | ||
347 | return out_of_line_wait_on_bit_timeout(word, bit, bit_wait_timeout, | ||
348 | mode, timeout); | ||
349 | } | ||
350 | |||
351 | static inline void btusb_free_frags(struct btusb_data *data) | 341 | static inline void btusb_free_frags(struct btusb_data *data) |
352 | { | 342 | { |
353 | unsigned long flags; | 343 | unsigned long flags; |
@@ -2196,9 +2186,9 @@ static int btusb_setup_intel_new(struct hci_dev *hdev) | |||
2196 | * and thus just timeout if that happens and fail the setup | 2186 | * and thus just timeout if that happens and fail the setup |
2197 | * of this device. | 2187 | * of this device. |
2198 | */ | 2188 | */ |
2199 | err = btusb_wait_on_bit_timeout(&data->flags, BTUSB_DOWNLOADING, | 2189 | err = wait_on_bit_timeout(&data->flags, BTUSB_DOWNLOADING, |
2200 | msecs_to_jiffies(5000), | 2190 | TASK_INTERRUPTIBLE, |
2201 | TASK_INTERRUPTIBLE); | 2191 | msecs_to_jiffies(5000)); |
2202 | if (err == 1) { | 2192 | if (err == 1) { |
2203 | BT_ERR("%s: Firmware loading interrupted", hdev->name); | 2193 | BT_ERR("%s: Firmware loading interrupted", hdev->name); |
2204 | err = -EINTR; | 2194 | err = -EINTR; |
@@ -2249,9 +2239,9 @@ done: | |||
2249 | */ | 2239 | */ |
2250 | BT_INFO("%s: Waiting for device to boot", hdev->name); | 2240 | BT_INFO("%s: Waiting for device to boot", hdev->name); |
2251 | 2241 | ||
2252 | err = btusb_wait_on_bit_timeout(&data->flags, BTUSB_BOOTING, | 2242 | err = wait_on_bit_timeout(&data->flags, BTUSB_BOOTING, |
2253 | msecs_to_jiffies(1000), | 2243 | TASK_INTERRUPTIBLE, |
2254 | TASK_INTERRUPTIBLE); | 2244 | msecs_to_jiffies(1000)); |
2255 | 2245 | ||
2256 | if (err == 1) { | 2246 | if (err == 1) { |
2257 | BT_ERR("%s: Device boot interrupted", hdev->name); | 2247 | BT_ERR("%s: Device boot interrupted", hdev->name); |