Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2005-01-20 16:24:09 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-20 16:24:09 -0800
commit176b50ec6f51ab12ccbd74b03515107e4bb0e21a (patch)
tree877541dc4cd295fece69b071435d47e5f4328b6b
parentb854b3defb654cf43eb2c43e3094bd1d1e1132dd (diff)
[PATCH] Lock initializer cleanup: Misc drivers
Use the new lock initializers DEFINE_SPIN_LOCK and DEFINE_RW_LOCK Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/acorn/block/fd1772.c2
-rw-r--r--drivers/acorn/block/mfmhd.c2
-rw-r--r--drivers/acpi/bus.c2
-rw-r--r--drivers/acpi/ec.c2
-rw-r--r--drivers/acpi/event.c2
-rw-r--r--drivers/acpi/pci_irq.c2
-rw-r--r--drivers/acpi/scan.c2
-rw-r--r--drivers/atm/idt77105.c2
-rw-r--r--drivers/atm/suni.c2
-rw-r--r--drivers/base/class_simple.c2
-rw-r--r--drivers/cdrom/aztcd.c2
-rw-r--r--drivers/cdrom/cdrom.c2
-rw-r--r--drivers/cdrom/cdu31a.c2
-rw-r--r--drivers/cdrom/cm206.c2
-rw-r--r--drivers/cdrom/gscd.c2
-rw-r--r--drivers/cdrom/mcd.c2
-rw-r--r--drivers/cdrom/mcdx.c2
-rw-r--r--drivers/cdrom/optcd.c2
-rw-r--r--drivers/cdrom/sbpcd.c2
-rw-r--r--drivers/cdrom/sjcd.c2
-rw-r--r--drivers/cdrom/sonycd535.c2
-rw-r--r--drivers/cpufreq/cpufreq.c4
-rw-r--r--drivers/firmware/efivars.c2
-rw-r--r--drivers/i2c/i2c-dev.c2
-rw-r--r--drivers/input/misc/pcspkr.c2
-rw-r--r--drivers/input/misc/sparcspkr.c2
-rw-r--r--drivers/input/serio/i8042.c2
-rw-r--r--drivers/input/serio/q40kbd.c2
-rw-r--r--drivers/input/serio/serio.c2
-rw-r--r--drivers/macintosh/adb.c2
-rw-r--r--drivers/macintosh/adbhid.c2
-rw-r--r--drivers/macintosh/macio-adb.c2
-rw-r--r--drivers/macintosh/via-cuda.c2
-rw-r--r--drivers/macintosh/via-pmu.c2
-rw-r--r--drivers/message/fusion/mptlan.c2
-rw-r--r--drivers/message/fusion/mptscsih.c2
-rw-r--r--drivers/oprofile/buffer_sync.c2
-rw-r--r--drivers/oprofile/oprofilefs.c2
-rw-r--r--drivers/parport/daisy.c2
-rw-r--r--drivers/parport/parport_pc.c2
-rw-r--r--drivers/parport/share.c4
-rw-r--r--drivers/pcmcia/au1000_generic.c2
-rw-r--r--drivers/pcmcia/i82092.c2
-rw-r--r--drivers/pcmcia/i82365.c4
-rw-r--r--drivers/pcmcia/m32r_cfc.c2
-rw-r--r--drivers/pcmcia/m32r_pcc.c2
-rw-r--r--drivers/pcmcia/pd6729.c2
-rw-r--r--drivers/pcmcia/soc_common.c2
-rw-r--r--drivers/pnp/core.c2
-rw-r--r--drivers/s390/block/dasd_devmap.c2
-rw-r--r--drivers/s390/char/con3215.c2
-rw-r--r--drivers/s390/char/sclp.c2
-rw-r--r--drivers/s390/char/tape_core.c2
-rw-r--r--drivers/s390/cio/css.c2
-rw-r--r--drivers/s390/cio/device_id.c2
-rw-r--r--drivers/s390/cio/qdio.c2
-rw-r--r--drivers/s390/net/iucv.c4
-rw-r--r--drivers/s390/net/smsgiucv.c2
-rw-r--r--drivers/sbus/char/bpp.c2
-rw-r--r--drivers/sbus/char/flash.c2
-rw-r--r--drivers/sbus/char/jsflash.c2
-rw-r--r--drivers/sbus/char/riowatchdog.c2
-rw-r--r--drivers/sbus/char/vfc_dev.c2
-rw-r--r--drivers/w1/w1.c2
-rw-r--r--drivers/w1/w1_family.c2
65 files changed, 69 insertions, 69 deletions
diff --git a/drivers/acorn/block/fd1772.c b/drivers/acorn/block/fd1772.c
index 9cc2e8436b45..3cd2e968e96c 100644
--- a/drivers/acorn/block/fd1772.c
+++ b/drivers/acorn/block/fd1772.c
@@ -1522,7 +1522,7 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data)
int fd1772_init(void)
{
- static spinlock_t lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(lock);
int i, err = -ENOMEM;
if (!machine_is_archimedes())
diff --git a/drivers/acorn/block/mfmhd.c b/drivers/acorn/block/mfmhd.c
index 45779b6bb0c7..4b65f74d66b1 100644
--- a/drivers/acorn/block/mfmhd.c
+++ b/drivers/acorn/block/mfmhd.c
@@ -124,7 +124,7 @@
static void (*do_mfm)(void) = NULL;
static struct request_queue *mfm_queue;
-static spinlock_t mfm_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(mfm_lock);
#define MAJOR_NR MFM_ACORN_MAJOR
#define QUEUE (mfm_queue)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index a589c2a1ffad..4edff1738579 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -281,7 +281,7 @@ EXPORT_SYMBOL(acpi_bus_set_power);
Event Management
-------------------------------------------------------------------------- */
-static spinlock_t acpi_bus_event_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(acpi_bus_event_lock);
LIST_HEAD(acpi_bus_event_list);
DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue);
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index a8edcf1bdaa4..8d4219388c9a 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -832,7 +832,7 @@ acpi_fake_ecdt_callback (
status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec_ecdt->gpe_bit);
if (ACPI_FAILURE(status))
return status;
- ec_ecdt->lock = SPIN_LOCK_UNLOCKED;
+ spin_lock_init(&ec_ecdt->lock);
ec_ecdt->global_lock = TRUE;
ec_ecdt->handle = handle;
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index 385fc65bf29f..43c49f66a328 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -16,7 +16,7 @@
ACPI_MODULE_NAME ("event")
/* Global vars for handling event proc entry */
-static spinlock_t acpi_system_event_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(acpi_system_event_lock);
int event_is_open = 0;
extern struct list_head acpi_bus_event_list;
extern wait_queue_head_t acpi_bus_event_queue;
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 1224cfc2245f..b4c265837da1 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -43,7 +43,7 @@
ACPI_MODULE_NAME ("pci_irq")
struct acpi_prt_list acpi_prt;
-spinlock_t acpi_prt_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(acpi_prt_lock);
/* --------------------------------------------------------------------------
PCI IRQ Routing Table (PRT) Support
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 9ff6ccfdc4bf..f20d88d3c554 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -24,7 +24,7 @@ extern struct acpi_device *acpi_root;
#define ACPI_BUS_DEVICE_NAME "System Bus"
static LIST_HEAD(acpi_device_list);
-spinlock_t acpi_device_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(acpi_device_lock);
LIST_HEAD(acpi_wakeup_device_list);
static void acpi_device_release(struct kobject * kobj)
diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
index 9d36cfc175e9..b8c260ed4b27 100644
--- a/drivers/atm/idt77105.c
+++ b/drivers/atm/idt77105.c
@@ -39,7 +39,7 @@ struct idt77105_priv {
unsigned char old_mcr; /* storage of MCR reg while signal lost */
};
-static spinlock_t idt77105_priv_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(idt77105_priv_lock);
#define PRIV(dev) ((struct idt77105_priv *) dev->phy_data)
diff --git a/drivers/atm/suni.c b/drivers/atm/suni.c
index 678df94184dc..06817dec0c25 100644
--- a/drivers/atm/suni.c
+++ b/drivers/atm/suni.c
@@ -48,7 +48,7 @@ struct suni_priv {
static struct timer_list poll_timer;
static struct suni_priv *sunis = NULL;
-static spinlock_t sunis_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(sunis_lock);
#define ADD_LIMITED(s,v) \
diff --git a/drivers/base/class_simple.c b/drivers/base/class_simple.c
index 8a3b8fa7ed5b..682e73bd3f49 100644
--- a/drivers/base/class_simple.c
+++ b/drivers/base/class_simple.c
@@ -27,7 +27,7 @@ struct simple_dev {
#define to_simple_dev(d) container_of(d, struct simple_dev, class_dev)
static LIST_HEAD(simple_dev_list);
-static spinlock_t simple_dev_list_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(simple_dev_list_lock);
static void release_simple_dev(struct class_device *class_dev)
{
diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c
index 4304ee708c09..c7ab4350c268 100644
--- a/drivers/cdrom/aztcd.c
+++ b/drivers/cdrom/aztcd.c
@@ -312,7 +312,7 @@ static unsigned char aztIndatum;
static unsigned long aztTimeOutCount;
static int aztCmd = 0;
-static spinlock_t aztSpin = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(aztSpin);
/*###########################################################################
Function Prototypes
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 36dd2004840d..9deca49c71f0 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -303,7 +303,7 @@ module_param(lockdoor, bool, 0);
module_param(check_media_type, bool, 0);
module_param(mrw_format_restart, bool, 0);
-static spinlock_t cdrom_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(cdrom_lock);
static const char *mrw_format_status[] = {
"not mrw",
diff --git a/drivers/cdrom/cdu31a.c b/drivers/cdrom/cdu31a.c
index 4a447b750d93..d729ae4b3f15 100644
--- a/drivers/cdrom/cdu31a.c
+++ b/drivers/cdrom/cdu31a.c
@@ -236,7 +236,7 @@ static volatile unsigned short sony_cd_read_reg;
static volatile unsigned short sony_cd_fifost_reg;
static struct request_queue *cdu31a_queue;
-static spinlock_t cdu31a_lock = SPIN_LOCK_UNLOCKED; /* queue lock */
+static DEFINE_SPINLOCK(cdu31a_lock); /* queue lock */
static int sony_spun_up = 0; /* Has the drive been spun up? */
diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c
index ccd2603625df..da80b14335a5 100644
--- a/drivers/cdrom/cm206.c
+++ b/drivers/cdrom/cm206.c
@@ -302,7 +302,7 @@ struct cm206_struct {
static struct cm206_struct *cd; /* the main memory structure */
static struct request_queue *cm206_queue;
-static spinlock_t cm206_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(cm206_lock);
/* First, we define some polling functions. These are actually
only being used in the initialization. */
diff --git a/drivers/cdrom/gscd.c b/drivers/cdrom/gscd.c
index ccf2af8f2594..7eac10e63b23 100644
--- a/drivers/cdrom/gscd.c
+++ b/drivers/cdrom/gscd.c
@@ -147,7 +147,7 @@ static int AudioEnd_m;
static int AudioEnd_f;
static struct timer_list gscd_timer = TIMER_INITIALIZER(NULL, 0, 0);
-static spinlock_t gscd_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(gscd_lock);
static struct request_queue *gscd_queue;
static struct block_device_operations gscd_fops = {
diff --git a/drivers/cdrom/mcd.c b/drivers/cdrom/mcd.c
index 821f7dec108b..55db09b9cfdf 100644
--- a/drivers/cdrom/mcd.c
+++ b/drivers/cdrom/mcd.c
@@ -187,7 +187,7 @@ static int mcd_open(struct cdrom_device_info *cdi, int purpose);
static void mcd_release(struct cdrom_device_info *cdi);
static int mcd_media_changed(struct cdrom_device_info *cdi, int disc_nr);
static int mcd_tray_move(struct cdrom_device_info *cdi, int position);
-static spinlock_t mcd_spinlock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(mcd_spinlock);
static int mcd_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
void *arg);
static int mcd_drive_status(struct cdrom_device_info *cdi, int slot_nr);
diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c
index 5e294e61992c..387539d287de 100644
--- a/drivers/cdrom/mcdx.c
+++ b/drivers/cdrom/mcdx.c
@@ -305,7 +305,7 @@ static int mcdx_setattentuator(struct s_drive_stuff *,
static int mcdx_drive_map[][2] = MCDX_DRIVEMAP;
static struct s_drive_stuff *mcdx_stuffp[MCDX_NDRIVES];
-static spinlock_t mcdx_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(mcdx_lock);
static struct request_queue *mcdx_queue;
/* You can only set the first two pairs, from old MODULE_PARM code. */
diff --git a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c
index edaff299d59d..7e69c54568bf 100644
--- a/drivers/cdrom/optcd.c
+++ b/drivers/cdrom/optcd.c
@@ -265,7 +265,7 @@ static int sleep_timeout; /* max # of ticks to sleep */
static DECLARE_WAIT_QUEUE_HEAD(waitq);
static void sleep_timer(unsigned long data);
static struct timer_list delay_timer = TIMER_INITIALIZER(sleep_timer, 0, 0);
-static spinlock_t optcd_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(optcd_lock);
static struct request_queue *opt_queue;
/* Timer routine: wake up when desired flag goes low,
diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c
index 8b4a2d4eb45a..31e563f976c1 100644
--- a/drivers/cdrom/sbpcd.c
+++ b/drivers/cdrom/sbpcd.c
@@ -461,7 +461,7 @@ static int sbpcd[] =
/*
* Protects access to global structures etc.
*/
-static spinlock_t sbpcd_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED;
+static __cacheline_aligned DEFINE_SPINLOCK(sbpcd_lock);
static struct request_queue *sbpcd_queue;
MODULE_PARM(sbpcd, "2i");
diff --git a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c
index 5e87209da475..f444b2548479 100644
--- a/drivers/cdrom/sjcd.c
+++ b/drivers/cdrom/sjcd.c
@@ -107,7 +107,7 @@ static volatile unsigned char sjcd_completion_status = 0;
static volatile unsigned char sjcd_completion_error = 0;
static unsigned short sjcd_command_is_in_progress = 0;
static unsigned short sjcd_error_reported = 0;
-static spinlock_t sjcd_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(sjcd_lock);
static int sjcd_open_count;
diff --git a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c
index f184e29625a9..f4be7bfd6675 100644
--- a/drivers/cdrom/sonycd535.c
+++ b/drivers/cdrom/sonycd535.c
@@ -222,7 +222,7 @@ static unsigned short command_reg;
static unsigned short read_status_reg;
static unsigned short data_reg;
-static spinlock_t sonycd535_lock = SPIN_LOCK_UNLOCKED; /* queue lock */
+static DEFINE_SPINLOCK(sonycd535_lock); /* queue lock */
static struct request_queue *sonycd535_queue;
static int initialized; /* Has the drive been initialized? */
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 30d9c6a87a0e..6af655507e50 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -33,7 +33,7 @@
*/
static struct cpufreq_driver *cpufreq_driver;
static struct cpufreq_policy *cpufreq_cpu_data[NR_CPUS];
-static spinlock_t cpufreq_driver_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(cpufreq_driver_lock);
/* we keep a copy of all ->add'ed CPU's struct sys_device here;
@@ -130,7 +130,7 @@ static unsigned int debug_ratelimit = 1;
* is set, and disabled upon cpufreq driver removal
*/
static unsigned int disable_ratelimit = 1;
-static spinlock_t disable_ratelimit_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(disable_ratelimit_lock);
static inline void cpufreq_debug_enable_ratelimit(void)
{
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index bac72bbaf723..9dc51ffef701 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -97,7 +97,7 @@ MODULE_VERSION(EFIVARS_VERSION);
* efi.get_next_variable() is only called from efivars_init(),
* which is protected by the BKL, so that path is safe.
*/
-static spinlock_t efivars_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(efivars_lock);
static LIST_HEAD(efivar_list);
/*
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index fcb62f335568..b829c571fc27 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -53,7 +53,7 @@ struct i2c_dev {
#define I2C_MINORS 256
static struct i2c_dev *i2c_dev_array[I2C_MINORS];
-static spinlock_t i2c_dev_array_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(i2c_dev_array_lock);
struct i2c_dev *i2c_dev_get_by_minor(unsigned index)
{
diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
index 830d1c37ca1f..58a39fd93fb8 100644
--- a/drivers/input/misc/pcspkr.c
+++ b/drivers/input/misc/pcspkr.c
@@ -27,7 +27,7 @@ static char pcspkr_name[] = "PC Speaker";
static char pcspkr_phys[] = "isa0061/input0";
static struct input_dev pcspkr_dev;
-spinlock_t i8253_beep_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(i8253_beep_lock);
static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
{
diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c
index 6d793addf65a..cdc3fb3d5f46 100644
--- a/drivers/input/misc/sparcspkr.c
+++ b/drivers/input/misc/sparcspkr.c
@@ -27,7 +27,7 @@ static char *sparcspkr_ebus_name = "Sparc EBUS Speaker";
static char *sparcspkr_phys = "sparc/input0";
static struct input_dev sparcspkr_dev;
-spinlock_t beep_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(beep_lock);
static void __init init_sparcspkr_struct(void)
{
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index dc816c72f36d..3adf480be630 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -76,7 +76,7 @@ __obsolete_setup("i8042_dumbkbd");
#include "i8042.h"
-spinlock_t i8042_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(i8042_lock);
struct i8042_values {
int irq;
diff --git a/drivers/input/serio/q40kbd.c b/drivers/input/serio/q40kbd.c
index a56ea2b73f12..ab4425db304c 100644
--- a/drivers/input/serio/q40kbd.c
+++ b/drivers/input/serio/q40kbd.c
@@ -48,7 +48,7 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Q40 PS/2 keyboard controller driver");
MODULE_LICENSE("GPL");
-spinlock_t q40kbd_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(q40kbd_lock);
static struct serio *q40kbd_port;
static struct platform_device *q40kbd_device;
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 77005b4c44a0..754b444d5ac5 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -113,7 +113,7 @@ enum serio_event_type {
SERIO_UNREGISTER_PORT,
};
-static spinlock_t serio_event_lock = SPIN_LOCK_UNLOCKED; /* protects serio_event_list */
+static DEFINE_SPINLOCK(serio_event_lock); /* protects serio_event_list */
static LIST_HEAD(serio_event_list);
static DECLARE_WAIT_QUEUE_HEAD(serio_wait);
static DECLARE_COMPLETION(serio_exited);
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index b7cc2da372f4..5855bbf02e27 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -120,7 +120,7 @@ static struct adb_handler {
* called.
*/
static DECLARE_MUTEX(adb_handler_sem);
-static rwlock_t adb_handler_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(adb_handler_lock);
#if 0
static void printADBreply(struct adb_request *req)
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
index d3b8f819e509..8f93d01d8928 100644
--- a/drivers/macintosh/adbhid.c
+++ b/drivers/macintosh/adbhid.c
@@ -569,7 +569,7 @@ static int leds_req_pending;
static int pending_devs[16];
static int pending_led_start=0;
static int pending_led_end=0;
-static spinlock_t leds_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(leds_lock);
static void leds_done(struct adb_request *req)
{
diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c
index d4e651b01d57..cf6a6f2248ac 100644
--- a/drivers/macintosh/macio-adb.c
+++ b/drivers/macintosh/macio-adb.c
@@ -59,7 +59,7 @@ struct adb_regs {
static volatile struct adb_regs __iomem *adb;
static struct adb_request *current_req, *last_req;
-static spinlock_t macio_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(macio_lock);
static int macio_probe(void);
static int macio_init(void);
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
index e5e3d0202820..417deb5de108 100644
--- a/drivers/macintosh/via-cuda.c
+++ b/drivers/macintosh/via-cuda.c
@@ -33,7 +33,7 @@
#include <linux/init.h>
static volatile unsigned char __iomem *via;
-static spinlock_t cuda_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(cuda_lock);
#ifdef CONFIG_MAC
#define CUDA_IRQ IRQ_MAC_ADB
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 72c5165ffb12..2091df715420 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -2721,7 +2721,7 @@ struct pmu_private {
};
static LIST_HEAD(all_pmu_pvt);
-static spinlock_t all_pvt_lock __pmacdata = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(all_pvt_lock __pmacdata);
static void __pmac
pmu_pass_intr(unsigned char *data, int len)
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c
index a5725446176e..ef2713b93fab 100644
--- a/drivers/message/fusion/mptlan.c
+++ b/drivers/message/fusion/mptlan.c
@@ -179,7 +179,7 @@ static u32 tx_max_out_p = 127 - 16;
#ifdef QLOGIC_NAA_WORKAROUND
static struct NAA_Hosed *mpt_bad_naa = NULL;
-rwlock_t bad_naa_lock = RW_LOCK_UNLOCKED;
+DEFINE_RWLOCK(bad_naa_lock);
#endif
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 65ffd15fa03c..0a11f963f3a2 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -241,7 +241,7 @@ static int ScsiScanDvCtx = -1; /* Used only for bus scan and dv */
/*
* Domain Validation task structure
*/
-static spinlock_t dvtaskQ_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(dvtaskQ_lock);
static int dvtaskQ_active = 0;
static int dvtaskQ_release = 0;
static struct work_struct mptscsih_dvTask;
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index 59ac78146d2e..9ac2dab4d705 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -35,7 +35,7 @@
static LIST_HEAD(dying_tasks);
static LIST_HEAD(dead_tasks);
cpumask_t marked_cpus = CPU_MASK_NONE;
-static spinlock_t task_mortuary = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(task_mortuary);
void process_task_mortuary(void);
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c
index 1247fe9bfaaa..d6bae699749a 100644
--- a/drivers/oprofile/oprofilefs.c
+++ b/drivers/oprofile/oprofilefs.c
@@ -21,7 +21,7 @@
#define OPROFILEFS_MAGIC 0x6f70726f
-spinlock_t oprofilefs_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(oprofilefs_lock);
static struct inode * oprofilefs_get_inode(struct super_block * sb, int mode)
{
diff --git a/drivers/parport/daisy.c b/drivers/parport/daisy.c
index b07e0a329a88..075c7eb5c85d 100644
--- a/drivers/parport/daisy.c
+++ b/drivers/parport/daisy.c
@@ -41,7 +41,7 @@ static struct daisydev {
int daisy;
int devnum;
} *topology = NULL;
-static spinlock_t topology_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(topology_lock);
static int numdevs = 0;
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 9d1570d392af..5af551df9367 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2130,7 +2130,7 @@ static int __devinit parport_dma_probe (struct parport *p)
/* --- Initialisation code -------------------------------- */
static LIST_HEAD(ports_list);
-static spinlock_t ports_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(ports_lock);
struct parport *parport_pc_probe_port (unsigned long int base,
unsigned long int base_hi,
diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index 76dcb24e2fa4..ae7becf7efa5 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -42,11 +42,11 @@ unsigned long parport_default_timeslice = PARPORT_DEFAULT_TIMESLICE;
int parport_default_spintime = DEFAULT_SPIN_TIME;
static LIST_HEAD(portlist);
-static spinlock_t parportlist_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(parportlist_lock);
/* list of all allocated ports, sorted by ->number */
static LIST_HEAD(all_ports);
-static spinlock_t full_list_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(full_list_lock);
static LIST_HEAD(drivers);
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index 124225edcac8..82a27ed589ff 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -141,7 +141,7 @@ static struct pccard_operations au1000_pcmcia_operations = {
#endif
};
-static spinlock_t pcmcia_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(pcmcia_lock);
static int __init au1000_pcmcia_driver_init(void)
{
diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index aa8ed192d21a..bc147ce389a9 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -200,7 +200,7 @@ static void __devexit i82092aa_pci_remove(struct pci_dev *dev)
leave("i82092aa_pci_remove");
}
-static spinlock_t port_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(port_lock);
/* basic value read/write functions */
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index 0d9bb1505c2e..ea53ffa2ea13 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -186,7 +186,7 @@ static struct i82365_socket socket[8] = {
#define I365_MASK 0xdeb8 /* irq 15,14,12,11,10,9,7,5,4,3 */
static int grab_irq;
-static spinlock_t isa_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(isa_lock);
#define ISA_LOCK(n, f) spin_lock_irqsave(&isa_lock, f)
#define ISA_UNLOCK(n, f) spin_unlock_irqrestore(&isa_lock, f)
@@ -233,7 +233,7 @@ static pcic_t pcic[] = {
/*====================================================================*/
-static spinlock_t bus_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(bus_lock);
static u_char i365_get(u_short sock, u_short reg)
{
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c
index 023013d3e263..5858736a4f6a 100644
--- a/drivers/pcmcia/m32r_cfc.c
+++ b/drivers/pcmcia/m32r_cfc.c
@@ -86,7 +86,7 @@ static pcc_socket_t socket[M32R_MAX_PCC] = {
static unsigned int pcc_get(u_short, unsigned int);
static void pcc_set(u_short, unsigned int , unsigned int );
-static spinlock_t pcc_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(pcc_lock);
#if !defined(CONFIG_PLAT_USRV)
static inline u_long pcc_port2addr(unsigned long port, int size) {
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c
index 8c881ae73287..1ab47afe26d7 100644
--- a/drivers/pcmcia/m32r_pcc.c
+++ b/drivers/pcmcia/m32r_pcc.c
@@ -96,7 +96,7 @@ static pcc_socket_t socket[M32R_MAX_PCC] = {
static unsigned int pcc_get(u_short, unsigned int);
static void pcc_set(u_short, unsigned int , unsigned int );
-static spinlock_t pcc_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(pcc_lock);
void pcc_iorw(int sock, unsigned long port, void *buf, size_t size, size_t nmemb, int wr, int flag)
{
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 1347f94260c7..05da3bf154ed 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -67,7 +67,7 @@ MODULE_PARM_DESC(irq_mode,
"interrupt delivery mode. 0 = ISA, 1 = PCI. default is 1");
MODULE_PARM_DESC(irq_list, "interrupts that can be used by PCMCIA cards");
-static spinlock_t port_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(port_lock);
/* basic value read/write functions */
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index 20dd66b245bc..328e0fe8f71f 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -208,7 +208,7 @@ static int soc_common_pcmcia_suspend(struct pcmcia_socket *sock)
return ret;
}
-static spinlock_t status_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(status_lock);
static void soc_common_check_status(struct soc_pcmcia_socket *skt)
{
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c
index 082adeae0717..34029a39ef46 100644
--- a/drivers/pnp/core.c
+++ b/drivers/pnp/core.c
@@ -20,7 +20,7 @@
LIST_HEAD(pnp_protocols);
LIST_HEAD(pnp_global);
-spinlock_t pnp_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(pnp_lock);
void *pnp_alloc(long size)
{
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index 0dea49d3dc96..ad1841a96c87 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -73,7 +73,7 @@ static char *dasd[256];
/*
* Single spinlock to protect devmap structures and lists.
*/
-static spinlock_t dasd_devmap_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(dasd_devmap_lock);
/*
* Hash lists for devmap structures.
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index e74554b9d4d7..022f17bff731 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -102,7 +102,7 @@ struct raw3215_info {
/* array of 3215 devices structures */
static struct raw3215_info *raw3215[NR_3215];
/* spinlock to protect the raw3215 array */
-static spinlock_t raw3215_device_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(raw3215_device_lock);
/* list of free request structures */
static struct raw3215_req *raw3215_freelist;
/* spinlock to protect free list */
diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c
index c1c36c9ed28c..ceb0e474fde4 100644
--- a/drivers/s390/char/sclp.c
+++ b/drivers/s390/char/sclp.c
@@ -26,7 +26,7 @@
static ext_int_info_t ext_int_info_hwc;
/* Lock to protect internal data consistency. */
-static spinlock_t sclp_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(sclp_lock);
/* Mask of events that we can receive from the sclp interface. */
static sccb_mask_t sclp_receive_mask;
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
index cb3ebe748fb8..e51046ab8adc 100644
--- a/drivers/s390/char/tape_core.c
+++ b/drivers/s390/char/tape_core.c
@@ -36,7 +36,7 @@ static void __tape_remove_request(struct tape_device *, struct tape_request *);
* The list is protected by the rwlock
*/
static struct list_head tape_device_list = LIST_HEAD_INIT(tape_device_list);
-static rwlock_t tape_device_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(tape_device_lock);
/*
* Pointer to debug area.
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 64f25944bdbf..55c57976151c 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -304,7 +304,7 @@ struct slow_subchannel {
};
static LIST_HEAD(slow_subchannels_head);
-static spinlock_t slow_subchannel_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(slow_subchannel_lock);
static void
css_trigger_slow_path(void)
diff --git a/drivers/s390/cio/device_id.c b/drivers/s390/cio/device_id.c
index f6cb8972884c..9e5840fc6b21 100644
--- a/drivers/s390/cio/device_id.c
+++ b/drivers/s390/cio/device_id.c
@@ -36,7 +36,7 @@ diag210(struct diag210 * addr)
* use a static data area to be sure
*/
static struct diag210 diag210_tmp;
- static spinlock_t diag210_lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(diag210_lock);
unsigned long flags;
int ccode;
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index 46105ed76d54..bbe9f45d1438 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -95,7 +95,7 @@ static debug_info_t *qdio_dbf_slsb_in;
/* iQDIO stuff: */
static volatile struct qdio_q *tiq_list=NULL; /* volatile as it could change
during a while loop */
-static spinlock_t ttiq_list_lock=SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(ttiq_list_lock);
static int register_thinint_result;
static void tiqdio_tl(unsigned long);
static DECLARE_TASKLET(tiqdio_tasklet,tiqdio_tl,0);
diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c
index d0992c0ad28d..999991d0b670 100644
--- a/drivers/s390/net/iucv.c
+++ b/drivers/s390/net/iucv.c
@@ -103,7 +103,7 @@ static iucv_GeneralInterrupt *iucv_external_int_buffer = NULL;
/* Spin Lock declaration */
-static spinlock_t iucv_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(iucv_lock);
static int messagesDisabled = 0;
@@ -115,7 +115,7 @@ typedef struct {
} iucv_irqdata;
static struct list_head iucv_irq_queue;
-static spinlock_t iucv_irq_queue_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(iucv_irq_queue_lock);
/*
*Internal function prototypes
diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c
index 23b151c94855..a3d285859564 100644
--- a/drivers/s390/net/smsgiucv.c
+++ b/drivers/s390/net/smsgiucv.c
@@ -41,7 +41,7 @@ MODULE_DESCRIPTION ("Linux for S/390 IUCV special message driver");
static iucv_handle_t smsg_handle;
static unsigned short smsg_pathid;
-static spinlock_t smsg_list_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(smsg_list_lock);
static struct list_head smsg_list = LIST_HEAD_INIT(smsg_list);
static void
diff --git a/drivers/sbus/char/bpp.c b/drivers/sbus/char/bpp.c
index cf83dfd4425b..8f0f46907a81 100644
--- a/drivers/sbus/char/bpp.c
+++ b/drivers/sbus/char/bpp.c
@@ -432,7 +432,7 @@ static int terminate(unsigned minor)
return 0;
}
-static spinlock_t bpp_open_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(bpp_open_lock);
/*
* Allow only one process to open the device at a time.
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c
index 40a400e262ea..cf2457b667a4 100644
--- a/drivers/sbus/char/flash.c
+++ b/drivers/sbus/char/flash.c
@@ -24,7 +24,7 @@
#include <asm/ebus.h>
#include <asm/upa.h>
-static spinlock_t flash_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(flash_lock);
static struct {
unsigned long read_base; /* Physical read address */
unsigned long write_base; /* Physical write address */
diff --git a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c
index 0b886c69b7d5..c12c5046e2fa 100644
--- a/drivers/sbus/char/jsflash.c
+++ b/drivers/sbus/char/jsflash.c
@@ -539,7 +539,7 @@ static struct request_queue *jsf_queue;
static int jsfd_init(void)
{
- static spinlock_t lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(lock);
struct jsflash *jsf;
struct jsfd_part *jdp;
int err;
diff --git a/drivers/sbus/char/riowatchdog.c b/drivers/sbus/char/riowatchdog.c
index 9325cf7831c5..d1babff6a535 100644
--- a/drivers/sbus/char/riowatchdog.c
+++ b/drivers/sbus/char/riowatchdog.c
@@ -52,7 +52,7 @@ MODULE_LICENSE("GPL");
#define RIOWD_NAME "pmc"
#define RIOWD_MINOR 215
-static spinlock_t riowd_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(riowd_lock);
static void __iomem *bbc_regs;
static void __iomem *riowd_regs;
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c
index ad29b496b664..057a24bba81a 100644
--- a/drivers/sbus/char/vfc_dev.c
+++ b/drivers/sbus/char/vfc_dev.c
@@ -178,7 +178,7 @@ struct vfc_dev *vfc_get_dev_ptr(int instance)
return vfc_dev_lst[instance];
}
-static spinlock_t vfc_dev_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(vfc_dev_lock);
static int vfc_open(struct inode *inode, struct file *file)
{
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index d4ded1595cac..731ca8409edb 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -52,7 +52,7 @@ module_param_named(timeout, w1_timeout, int, 0);
module_param_named(max_slave_count, w1_max_slave_count, int, 0);
module_param_named(slave_ttl, w1_max_slave_ttl, int, 0);
-spinlock_t w1_mlock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(w1_mlock);
LIST_HEAD(w1_masters);
static pid_t control_thread;
diff --git a/drivers/w1/w1_family.c b/drivers/w1/w1_family.c
index a875ae733a13..ccde36d0fed5 100644
--- a/drivers/w1/w1_family.c
+++ b/drivers/w1/w1_family.c
@@ -25,7 +25,7 @@
#include "w1_family.h"
-spinlock_t w1_flock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(w1_flock);
static LIST_HEAD(w1_families);
static int w1_check_family(struct w1_family *f)