Commit 431738f0 authored by Markus Lidel's avatar Markus Lidel Committed by Linus Torvalds

[PATCH] i2o: converted SPIN_LOCK_UNLOCKED into spin_lock_init()

- changed initialization of spin locks from SPIN_LOCK_UNLOCKED into
  spin_lock_init()
Signed-off-by: default avatarMarkus Lidel <Markus.Lidel@shadowconnect.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent afd60c7d
...@@ -24,7 +24,7 @@ module_param_named(max_drivers, i2o_max_drivers, uint, 0); ...@@ -24,7 +24,7 @@ module_param_named(max_drivers, i2o_max_drivers, uint, 0);
MODULE_PARM_DESC(max_drivers, "maximum number of OSM's to support"); MODULE_PARM_DESC(max_drivers, "maximum number of OSM's to support");
/* I2O drivers lock and array */ /* I2O drivers lock and array */
static spinlock_t i2o_drivers_lock = SPIN_LOCK_UNLOCKED; static spinlock_t i2o_drivers_lock;
static struct i2o_driver **i2o_drivers; static struct i2o_driver **i2o_drivers;
/** /**
...@@ -327,6 +327,8 @@ int __init i2o_driver_init(void) ...@@ -327,6 +327,8 @@ int __init i2o_driver_init(void)
{ {
int rc = 0; int rc = 0;
spin_lock_init(&i2o_drivers_lock);
if ((i2o_max_drivers < 2) || (i2o_max_drivers > 64) || if ((i2o_max_drivers < 2) || (i2o_max_drivers > 64) ||
((i2o_max_drivers ^ (i2o_max_drivers - 1)) != ((i2o_max_drivers ^ (i2o_max_drivers - 1)) !=
(2 * i2o_max_drivers - 1))) { (2 * i2o_max_drivers - 1))) {
......
...@@ -202,10 +202,12 @@ static int i2o_msg_post_wait_complete(struct i2o_controller *c, u32 m, ...@@ -202,10 +202,12 @@ static int i2o_msg_post_wait_complete(struct i2o_controller *c, u32 m,
struct i2o_message *msg) struct i2o_message *msg)
{ {
struct i2o_exec_wait *wait, *tmp; struct i2o_exec_wait *wait, *tmp;
static spinlock_t lock = SPIN_LOCK_UNLOCKED; static spinlock_t lock;
int rc = 1; int rc = 1;
u32 context; u32 context;
spin_lock_init(&lock);
context = readl(&msg->u.s.tcntxt); context = readl(&msg->u.s.tcntxt);
/* /*
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
extern int i2o_parm_issue(struct i2o_device *, int, void *, int, void *, int); extern int i2o_parm_issue(struct i2o_device *, int, void *, int, void *, int);
static spinlock_t i2o_config_lock = SPIN_LOCK_UNLOCKED; static spinlock_t i2o_config_lock;
#define MODINC(x,y) ((x) = ((x) + 1) % (y)) #define MODINC(x,y) ((x) = ((x) + 1) % (y))
...@@ -1128,6 +1128,8 @@ static int __init i2o_config_init(void) ...@@ -1128,6 +1128,8 @@ static int __init i2o_config_init(void)
printk(KERN_INFO "I2O configuration manager v 0.04.\n"); printk(KERN_INFO "I2O configuration manager v 0.04.\n");
printk(KERN_INFO " (C) Copyright 1999 Red Hat Software\n"); printk(KERN_INFO " (C) Copyright 1999 Red Hat Software\n");
spin_lock_init(&i2o_config_lock);
if (misc_register(&i2o_miscdev) < 0) { if (misc_register(&i2o_miscdev) < 0) {
printk(KERN_ERR "i2o_config: can't register device.\n"); printk(KERN_ERR "i2o_config: can't register device.\n");
return -EBUSY; return -EBUSY;
......
...@@ -1121,13 +1121,13 @@ struct i2o_controller *i2o_iop_alloc(void) ...@@ -1121,13 +1121,13 @@ struct i2o_controller *i2o_iop_alloc(void)
memset(c, 0, sizeof(*c)); memset(c, 0, sizeof(*c));
INIT_LIST_HEAD(&c->devices); INIT_LIST_HEAD(&c->devices);
c->lock = SPIN_LOCK_UNLOCKED; spin_lock_init(&c->lock);
init_MUTEX(&c->lct_lock); init_MUTEX(&c->lct_lock);
c->unit = unit++; c->unit = unit++;
sprintf(c->name, "iop%d", c->unit); sprintf(c->name, "iop%d", c->unit);
#if BITS_PER_LONG == 64 #if BITS_PER_LONG == 64
c->context_list_lock = SPIN_LOCK_UNLOCKED; spin_lock_init(&c->context_list_lock);
atomic_set(&c->context_list_counter, 0); atomic_set(&c->context_list_counter, 0);
INIT_LIST_HEAD(&c->context_list); INIT_LIST_HEAD(&c->context_list);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment