diff options
author | Matt Wagner <mwagner@nvidia.com> | 2011-11-16 14:54:52 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 01:37:30 -0700 |
commit | 993a322b8e0d36ed30504b2edc5a7cb8e6b678a4 (patch) | |
tree | 8d9c6a51d2011f6b39faba44851859ab0ffd3e39 /drivers/bluetooth | |
parent | 99ad2ed6dd47d4bbbbe5e1b9673b97f0422dbe2e (diff) |
bluetooth: bluesleep: remove blocking call in bluesleep_start
bluesleep_start is not allowed to sleep because it's called by
an atomic_notifier, so we move request_irq to the probe function
Change-Id: I428bd6c9ab07cf7e5ab2029975cc9a617fea03b0
Reviewed-on: http://git-master/r/65018
Tested-by: Matt Wagner <mwagner@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Rebase-Id: R20e192cd7167915b6749a6ee267184b2e0a142fb
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/bluesleep.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/bluetooth/bluesleep.c b/drivers/bluetooth/bluesleep.c index c54952d9f24d..4891bb478ac2 100644 --- a/drivers/bluetooth/bluesleep.c +++ b/drivers/bluetooth/bluesleep.c @@ -372,21 +372,6 @@ static int bluesleep_start(void) if (bsi->has_ext_wake == 1) gpio_set_value(bsi->ext_wake, 1); set_bit(BT_EXT_WAKE, &flags); - - if (bsi->irq_polarity == POLARITY_LOW) { - retval = request_irq(bsi->host_wake_irq, bluesleep_hostwake_isr, - IRQF_DISABLED | IRQF_TRIGGER_FALLING, - "bluetooth hostwake", NULL); - } else { - retval = request_irq(bsi->host_wake_irq, bluesleep_hostwake_isr, - IRQF_DISABLED | IRQF_TRIGGER_RISING, - "bluetooth hostwake", NULL); - } - if (retval < 0) { - BT_ERR("Couldn't acquire BT_HOST_WAKE IRQ"); - goto fail; - } - #if BT_ENABLE_IRQ_WAKE retval = enable_irq_wake(bsi->host_wake_irq); if (retval < 0) { @@ -673,6 +658,20 @@ static int bluesleep_probe(struct platform_device *pdev) wake_lock_init(&bsi->wake_lock, WAKE_LOCK_SUSPEND, "bluesleep"); clear_bit(BT_SUSPEND, &flags); + if (bsi->irq_polarity == POLARITY_LOW) { + ret = request_irq(bsi->host_wake_irq, bluesleep_hostwake_isr, + IRQF_DISABLED | IRQF_TRIGGER_FALLING, + "bluetooth hostwake", NULL); + } else { + ret = request_irq(bsi->host_wake_irq, bluesleep_hostwake_isr, + IRQF_DISABLED | IRQF_TRIGGER_RISING, + "bluetooth hostwake", NULL); + } + if (ret < 0) { + BT_ERR("Couldn't acquire BT_HOST_WAKE IRQ"); + goto free_bt_ext_wake; + } + return 0; free_bt_ext_wake: |