summaryrefslogtreecommitdiff
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorMatt Wagner <mwagner@nvidia.com>2011-11-16 14:54:52 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:52:38 -0800
commit07eae15b3a554e69f3ccf42b60fd288ac9c54ed7 (patch)
tree034b85e3e1f0ff38d1caa779560108727affd55d /drivers/bluetooth
parent9abe4eeea8b3fcc59410136ea3b72945a0d3909d (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.c29
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: