diff options
author | Loic Poulain <loic.poulain@intel.com> | 2015-08-31 12:34:31 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-09-17 07:20:01 -0400 |
commit | 67c8bde04d8587a57112993d1342c62b851b0756 (patch) | |
tree | 8b6a89e85a073b42016bacca619146c528e6d9db /drivers/bluetooth/hci_intel.c | |
parent | f44e78a5fc5b103e4d7b04480365a128ca9184ee (diff) |
Bluetooth: hci_intel: Replace spinlock with mutex
Replace the device_intel list spinlock with a mutex.
devm_request_threaded_irq is not atomic and upcomming PM support should
be simpler.
Signed-off-by: Loic Poulain <loic.poulain@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/hci_intel.c')
-rw-r--r-- | drivers/bluetooth/hci_intel.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/bluetooth/hci_intel.c b/drivers/bluetooth/hci_intel.c index e35df282abe8..5d53185c2d99 100644 --- a/drivers/bluetooth/hci_intel.c +++ b/drivers/bluetooth/hci_intel.c | |||
@@ -67,7 +67,7 @@ struct intel_device { | |||
67 | }; | 67 | }; |
68 | 68 | ||
69 | static LIST_HEAD(intel_device_list); | 69 | static LIST_HEAD(intel_device_list); |
70 | static DEFINE_SPINLOCK(intel_device_list_lock); | 70 | static DEFINE_MUTEX(intel_device_list_lock); |
71 | 71 | ||
72 | struct intel_data { | 72 | struct intel_data { |
73 | struct sk_buff *rx_skb; | 73 | struct sk_buff *rx_skb; |
@@ -143,7 +143,7 @@ static int intel_set_power(struct hci_uart *hu, bool powered) | |||
143 | struct list_head *p; | 143 | struct list_head *p; |
144 | int err = -ENODEV; | 144 | int err = -ENODEV; |
145 | 145 | ||
146 | spin_lock(&intel_device_list_lock); | 146 | mutex_lock(&intel_device_list_lock); |
147 | 147 | ||
148 | list_for_each(p, &intel_device_list) { | 148 | list_for_each(p, &intel_device_list) { |
149 | struct intel_device *idev = list_entry(p, struct intel_device, | 149 | struct intel_device *idev = list_entry(p, struct intel_device, |
@@ -187,7 +187,7 @@ static int intel_set_power(struct hci_uart *hu, bool powered) | |||
187 | } | 187 | } |
188 | } | 188 | } |
189 | 189 | ||
190 | spin_unlock(&intel_device_list_lock); | 190 | mutex_unlock(&intel_device_list_lock); |
191 | 191 | ||
192 | return err; | 192 | return err; |
193 | } | 193 | } |
@@ -696,7 +696,7 @@ done: | |||
696 | bt_dev_info(hdev, "Device booted in %llu usecs", duration); | 696 | bt_dev_info(hdev, "Device booted in %llu usecs", duration); |
697 | 697 | ||
698 | /* Enable LPM if matching pdev with wakeup enabled */ | 698 | /* Enable LPM if matching pdev with wakeup enabled */ |
699 | spin_lock(&intel_device_list_lock); | 699 | mutex_lock(&intel_device_list_lock); |
700 | list_for_each(p, &intel_device_list) { | 700 | list_for_each(p, &intel_device_list) { |
701 | struct intel_device *dev = list_entry(p, struct intel_device, | 701 | struct intel_device *dev = list_entry(p, struct intel_device, |
702 | list); | 702 | list); |
@@ -706,7 +706,7 @@ done: | |||
706 | break; | 706 | break; |
707 | } | 707 | } |
708 | } | 708 | } |
709 | spin_unlock(&intel_device_list_lock); | 709 | mutex_unlock(&intel_device_list_lock); |
710 | 710 | ||
711 | if (!idev) | 711 | if (!idev) |
712 | goto no_lpm; | 712 | goto no_lpm; |
@@ -982,9 +982,9 @@ no_irq: | |||
982 | platform_set_drvdata(pdev, idev); | 982 | platform_set_drvdata(pdev, idev); |
983 | 983 | ||
984 | /* Place this instance on the device list */ | 984 | /* Place this instance on the device list */ |
985 | spin_lock(&intel_device_list_lock); | 985 | mutex_lock(&intel_device_list_lock); |
986 | list_add_tail(&idev->list, &intel_device_list); | 986 | list_add_tail(&idev->list, &intel_device_list); |
987 | spin_unlock(&intel_device_list_lock); | 987 | mutex_unlock(&intel_device_list_lock); |
988 | 988 | ||
989 | dev_info(&pdev->dev, "registered, gpio(%d)/irq(%d).\n", | 989 | dev_info(&pdev->dev, "registered, gpio(%d)/irq(%d).\n", |
990 | desc_to_gpio(idev->reset), idev->irq); | 990 | desc_to_gpio(idev->reset), idev->irq); |
@@ -998,9 +998,9 @@ static int intel_remove(struct platform_device *pdev) | |||
998 | 998 | ||
999 | device_wakeup_disable(&pdev->dev); | 999 | device_wakeup_disable(&pdev->dev); |
1000 | 1000 | ||
1001 | spin_lock(&intel_device_list_lock); | 1001 | mutex_lock(&intel_device_list_lock); |
1002 | list_del(&idev->list); | 1002 | list_del(&idev->list); |
1003 | spin_unlock(&intel_device_list_lock); | 1003 | mutex_unlock(&intel_device_list_lock); |
1004 | 1004 | ||
1005 | dev_info(&pdev->dev, "unregistered.\n"); | 1005 | dev_info(&pdev->dev, "unregistered.\n"); |
1006 | 1006 | ||