summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-11-09 00:40:29 -0800
committerDavid S. Miller <davem@nuts.davemloft.net>2004-11-09 00:40:29 -0800
commit8452fcd11f2846a5ca11ff04d18fe0d22ccb2788 (patch)
treeb89d11288ac318e3ba1dfbb34b1f2dbc3f0a1557 /drivers
parent1d49f2e7f8295ad022651820213c521fdd2b2d3f (diff)
[BLUETOOTH]: Lock initializer unifying
From: <tglx@linutronix.de> To make spinlock/rwlock initialization consistent all over the kernel, this patch converts explicit lock-initializers into spin_lock_init() and rwlock_init() calls. Currently, spinlocks and rwlocks are initialized in two different ways: lock = SPIN_LOCK_UNLOCKED spin_lock_init(&lock) rwlock = RW_LOCK_UNLOCKED rwlock_init(&rwlock) this patch converts all explicit lock initializations to spin_lock_init() or rwlock_init(). (Besides consistency this also helps automatic lock validators and debugging code.) The conversion was done with a script, it was verified manually and it was reviewed, compiled and tested as far as possible on x86, ARM, PPC. There is no runtime overhead or actual code change resulting out of this patch, because spin_lock_init() and rwlock_init() are macros and are thus equivalent to the explicit initialization method. That's the second batch of the unifying patches. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bluetooth/bfusb.c2
-rw-r--r--drivers/bluetooth/hci_usb.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index 95f808ac3fab..7803b91ee808 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -680,7 +680,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
bfusb->bulk_out_ep = bulk_out_ep->desc.bEndpointAddress;
bfusb->bulk_pkt_size = bulk_out_ep->desc.wMaxPacketSize;
- bfusb->lock = RW_LOCK_UNLOCKED;
+ rwlock_init(&bfusb->lock);
bfusb->reassembly = NULL;
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index 1b0bebafd4cd..244f39b02ec8 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -933,7 +933,7 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id
}
#endif
- husb->completion_lock = RW_LOCK_UNLOCKED;
+ rwlock_init(&husb->completion_lock);
for (i = 0; i < 4; i++) {
skb_queue_head_init(&husb->transmit_q[i]);