Commit 9f71a568 authored by Daniel Walker's avatar Daniel Walker Committed by Jeff Garzik

netdev: ehea: ehea_fw_handles semaphore to mutex

Converted the ehea_fw_handles.lock to a mutex.
Signed-off-by: default avatarDaniel Walker <dwalker@mvista.com>
Cc: Christoph Raisch <raisch@de.ibm.com>
Cc: Jan-Bernd Themann <themann@de.ibm.com>
Cc: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 06f89edf
...@@ -421,7 +421,7 @@ struct ehea_fw_handle_entry { ...@@ -421,7 +421,7 @@ struct ehea_fw_handle_entry {
struct ehea_fw_handle_array { struct ehea_fw_handle_array {
struct ehea_fw_handle_entry *arr; struct ehea_fw_handle_entry *arr;
int num_entries; int num_entries;
struct semaphore lock; struct mutex lock;
}; };
struct ehea_bcmc_reg_entry { struct ehea_bcmc_reg_entry {
......
...@@ -2453,7 +2453,7 @@ static int ehea_up(struct net_device *dev) ...@@ -2453,7 +2453,7 @@ static int ehea_up(struct net_device *dev)
if (port->state == EHEA_PORT_UP) if (port->state == EHEA_PORT_UP)
return 0; return 0;
down(&ehea_fw_handles.lock); mutex_lock(&ehea_fw_handles.lock);
ret = ehea_port_res_setup(port, port->num_def_qps, ret = ehea_port_res_setup(port, port->num_def_qps,
port->num_add_tx_qps); port->num_add_tx_qps);
...@@ -2517,7 +2517,7 @@ static int ehea_up(struct net_device *dev) ...@@ -2517,7 +2517,7 @@ static int ehea_up(struct net_device *dev)
up(&ehea_bcmc_regs.lock); up(&ehea_bcmc_regs.lock);
ehea_update_firmware_handles(); ehea_update_firmware_handles();
up(&ehea_fw_handles.lock); mutex_unlock(&ehea_fw_handles.lock);
return ret; return ret;
} }
...@@ -2573,7 +2573,7 @@ static int ehea_down(struct net_device *dev) ...@@ -2573,7 +2573,7 @@ static int ehea_down(struct net_device *dev)
ehea_free_interrupts(dev); ehea_free_interrupts(dev);
down(&ehea_fw_handles.lock); mutex_lock(&ehea_fw_handles.lock);
port->state = EHEA_PORT_DOWN; port->state = EHEA_PORT_DOWN;
...@@ -2586,7 +2586,7 @@ static int ehea_down(struct net_device *dev) ...@@ -2586,7 +2586,7 @@ static int ehea_down(struct net_device *dev)
dev->name, ret); dev->name, ret);
ehea_update_firmware_handles(); ehea_update_firmware_handles();
up(&ehea_fw_handles.lock); mutex_unlock(&ehea_fw_handles.lock);
return ret; return ret;
} }
...@@ -3343,7 +3343,7 @@ static int __devinit ehea_probe_adapter(struct of_device *dev, ...@@ -3343,7 +3343,7 @@ static int __devinit ehea_probe_adapter(struct of_device *dev,
ehea_error("Invalid ibmebus device probed"); ehea_error("Invalid ibmebus device probed");
return -EINVAL; return -EINVAL;
} }
down(&ehea_fw_handles.lock); mutex_lock(&ehea_fw_handles.lock);
adapter = kzalloc(sizeof(*adapter), GFP_KERNEL); adapter = kzalloc(sizeof(*adapter), GFP_KERNEL);
if (!adapter) { if (!adapter) {
...@@ -3427,7 +3427,7 @@ static int __devinit ehea_probe_adapter(struct of_device *dev, ...@@ -3427,7 +3427,7 @@ static int __devinit ehea_probe_adapter(struct of_device *dev,
out: out:
ehea_update_firmware_handles(); ehea_update_firmware_handles();
up(&ehea_fw_handles.lock); mutex_unlock(&ehea_fw_handles.lock);
return ret; return ret;
} }
...@@ -3446,7 +3446,7 @@ static int __devexit ehea_remove(struct of_device *dev) ...@@ -3446,7 +3446,7 @@ static int __devexit ehea_remove(struct of_device *dev)
flush_scheduled_work(); flush_scheduled_work();
down(&ehea_fw_handles.lock); mutex_lock(&ehea_fw_handles.lock);
ibmebus_free_irq(adapter->neq->attr.ist1, adapter); ibmebus_free_irq(adapter->neq->attr.ist1, adapter);
tasklet_kill(&adapter->neq_tasklet); tasklet_kill(&adapter->neq_tasklet);
...@@ -3457,7 +3457,7 @@ static int __devexit ehea_remove(struct of_device *dev) ...@@ -3457,7 +3457,7 @@ static int __devexit ehea_remove(struct of_device *dev)
kfree(adapter); kfree(adapter);
ehea_update_firmware_handles(); ehea_update_firmware_handles();
up(&ehea_fw_handles.lock); mutex_unlock(&ehea_fw_handles.lock);
return 0; return 0;
} }
...@@ -3544,7 +3544,7 @@ int __init ehea_module_init(void) ...@@ -3544,7 +3544,7 @@ int __init ehea_module_init(void)
memset(&ehea_fw_handles, 0, sizeof(ehea_fw_handles)); memset(&ehea_fw_handles, 0, sizeof(ehea_fw_handles));
memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs)); memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs));
sema_init(&ehea_fw_handles.lock, 1); mutex_init(&ehea_fw_handles.lock);
sema_init(&ehea_bcmc_regs.lock, 1); sema_init(&ehea_bcmc_regs.lock, 1);
ret = check_module_parm(); ret = check_module_parm();
......
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