Skip to content

Commit

Permalink
netdev: ehea: semaphore to mutex
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Walker authored and Jeff Garzik committed Mar 29, 2008
1 parent b7aa690 commit 06f89ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <asm/kexec.h>
#include <linux/mutex.h>

#include <net/ip.h>

Expand Down Expand Up @@ -99,7 +100,7 @@ static int port_name_cnt;
static LIST_HEAD(adapter_list);
u64 ehea_driver_flags;
struct work_struct ehea_rereg_mr_task;
struct semaphore dlpar_mem_lock;
static DEFINE_MUTEX(dlpar_mem_lock);
struct ehea_fw_handle_array ehea_fw_handles;
struct ehea_bcmc_reg_array ehea_bcmc_regs;

Expand Down Expand Up @@ -2830,7 +2831,7 @@ static void ehea_rereg_mrs(struct work_struct *work)
int ret, i;
struct ehea_adapter *adapter;

down(&dlpar_mem_lock);
mutex_lock(&dlpar_mem_lock);
ehea_info("LPAR memory enlarged - re-initializing driver");

list_for_each_entry(adapter, &adapter_list, list)
Expand Down Expand Up @@ -2902,7 +2903,7 @@ static void ehea_rereg_mrs(struct work_struct *work)
}
}
}
up(&dlpar_mem_lock);
mutex_unlock(&dlpar_mem_lock);
ehea_info("re-initializing driver complete");
out:
return;
Expand Down Expand Up @@ -3543,7 +3544,6 @@ int __init ehea_module_init(void)
memset(&ehea_fw_handles, 0, sizeof(ehea_fw_handles));
memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs));

sema_init(&dlpar_mem_lock, 1);
sema_init(&ehea_fw_handles.lock, 1);
sema_init(&ehea_bcmc_regs.lock, 1);

Expand Down

0 comments on commit 06f89ed

Please sign in to comment.