aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ehea
diff options
context:
space:
mode:
authorDaniel Walker <dwalker@mvista.com>2008-03-28 17:41:26 -0400
committerJeff Garzik <jeff@garzik.org>2008-03-28 22:14:25 -0400
commit06f89edf89f254346c95d0c569cecd606459d83e (patch)
tree41635a52de50efc56145b37527dce6463814da52 /drivers/net/ehea
parentb7aa69097acb86c118edaa5e339b714617062dfe (diff)
netdev: ehea: semaphore to mutex
Converted the dlpar_mem_lock. With a bit of cleanup, I converted to DEFINE_MUTEX() instead of a runtime init. I also made the lock static. Signed-off-by: Daniel Walker <dwalker@mvista.com> Cc: Christoph Raisch <raisch@de.ibm.com> Acked-by: Jan-Bernd Themann <themann@de.ibm.com> Cc: Thomas Klein <tklein@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ehea')
-rw-r--r--drivers/net/ehea/ehea_main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 07c742dd3f09..a3b3b165445a 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -36,6 +36,7 @@
36#include <linux/notifier.h> 36#include <linux/notifier.h>
37#include <linux/reboot.h> 37#include <linux/reboot.h>
38#include <asm/kexec.h> 38#include <asm/kexec.h>
39#include <linux/mutex.h>
39 40
40#include <net/ip.h> 41#include <net/ip.h>
41 42
@@ -99,7 +100,7 @@ static int port_name_cnt;
99static LIST_HEAD(adapter_list); 100static LIST_HEAD(adapter_list);
100u64 ehea_driver_flags; 101u64 ehea_driver_flags;
101struct work_struct ehea_rereg_mr_task; 102struct work_struct ehea_rereg_mr_task;
102struct semaphore dlpar_mem_lock; 103static DEFINE_MUTEX(dlpar_mem_lock);
103struct ehea_fw_handle_array ehea_fw_handles; 104struct ehea_fw_handle_array ehea_fw_handles;
104struct ehea_bcmc_reg_array ehea_bcmc_regs; 105struct ehea_bcmc_reg_array ehea_bcmc_regs;
105 106
@@ -2830,7 +2831,7 @@ static void ehea_rereg_mrs(struct work_struct *work)
2830 int ret, i; 2831 int ret, i;
2831 struct ehea_adapter *adapter; 2832 struct ehea_adapter *adapter;
2832 2833
2833 down(&dlpar_mem_lock); 2834 mutex_lock(&dlpar_mem_lock);
2834 ehea_info("LPAR memory enlarged - re-initializing driver"); 2835 ehea_info("LPAR memory enlarged - re-initializing driver");
2835 2836
2836 list_for_each_entry(adapter, &adapter_list, list) 2837 list_for_each_entry(adapter, &adapter_list, list)
@@ -2902,7 +2903,7 @@ static void ehea_rereg_mrs(struct work_struct *work)
2902 } 2903 }
2903 } 2904 }
2904 } 2905 }
2905 up(&dlpar_mem_lock); 2906 mutex_unlock(&dlpar_mem_lock);
2906 ehea_info("re-initializing driver complete"); 2907 ehea_info("re-initializing driver complete");
2907out: 2908out:
2908 return; 2909 return;
@@ -3543,7 +3544,6 @@ int __init ehea_module_init(void)
3543 memset(&ehea_fw_handles, 0, sizeof(ehea_fw_handles)); 3544 memset(&ehea_fw_handles, 0, sizeof(ehea_fw_handles));
3544 memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs)); 3545 memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs));
3545 3546
3546 sema_init(&dlpar_mem_lock, 1);
3547 sema_init(&ehea_fw_handles.lock, 1); 3547 sema_init(&ehea_fw_handles.lock, 1);
3548 sema_init(&ehea_bcmc_regs.lock, 1); 3548 sema_init(&ehea_bcmc_regs.lock, 1);
3549 3549