Commit da59cde4 authored by Daniel Walker's avatar Daniel Walker Committed by Jeff Garzik

netdev: ehea: bcmc_regs semaphore to mutex

Convert the ehea_bcmc_regs.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 dbbcbb2d
...@@ -434,7 +434,7 @@ struct ehea_bcmc_reg_entry { ...@@ -434,7 +434,7 @@ struct ehea_bcmc_reg_entry {
struct ehea_bcmc_reg_array { struct ehea_bcmc_reg_array {
struct ehea_bcmc_reg_entry *arr; struct ehea_bcmc_reg_entry *arr;
int num_entries; int num_entries;
struct semaphore lock; struct mutex lock;
}; };
#define EHEA_PORT_UP 1 #define EHEA_PORT_UP 1
......
...@@ -1759,7 +1759,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa) ...@@ -1759,7 +1759,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
memcpy(dev->dev_addr, mac_addr->sa_data, dev->addr_len); memcpy(dev->dev_addr, mac_addr->sa_data, dev->addr_len);
down(&ehea_bcmc_regs.lock); mutex_lock(&ehea_bcmc_regs.lock);
/* Deregister old MAC in pHYP */ /* Deregister old MAC in pHYP */
ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC); ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
...@@ -1777,7 +1777,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa) ...@@ -1777,7 +1777,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
out_upregs: out_upregs:
ehea_update_bcmc_registrations(); ehea_update_bcmc_registrations();
up(&ehea_bcmc_regs.lock); mutex_unlock(&ehea_bcmc_regs.lock);
out_free: out_free:
kfree(cb0); kfree(cb0);
out: out:
...@@ -1939,7 +1939,7 @@ static void ehea_set_multicast_list(struct net_device *dev) ...@@ -1939,7 +1939,7 @@ static void ehea_set_multicast_list(struct net_device *dev)
} }
ehea_promiscuous(dev, 0); ehea_promiscuous(dev, 0);
down(&ehea_bcmc_regs.lock); mutex_lock(&ehea_bcmc_regs.lock);
if (dev->flags & IFF_ALLMULTI) { if (dev->flags & IFF_ALLMULTI) {
ehea_allmulti(dev, 1); ehea_allmulti(dev, 1);
...@@ -1970,7 +1970,7 @@ static void ehea_set_multicast_list(struct net_device *dev) ...@@ -1970,7 +1970,7 @@ static void ehea_set_multicast_list(struct net_device *dev)
} }
out: out:
ehea_update_bcmc_registrations(); ehea_update_bcmc_registrations();
up(&ehea_bcmc_regs.lock); mutex_unlock(&ehea_bcmc_regs.lock);
return; return;
} }
...@@ -2491,7 +2491,7 @@ static int ehea_up(struct net_device *dev) ...@@ -2491,7 +2491,7 @@ static int ehea_up(struct net_device *dev)
} }
} }
down(&ehea_bcmc_regs.lock); mutex_lock(&ehea_bcmc_regs.lock);
ret = ehea_broadcast_reg_helper(port, H_REG_BCMC); ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
if (ret) { if (ret) {
...@@ -2514,7 +2514,7 @@ static int ehea_up(struct net_device *dev) ...@@ -2514,7 +2514,7 @@ static int ehea_up(struct net_device *dev)
ehea_info("Failed starting %s. ret=%i", dev->name, ret); ehea_info("Failed starting %s. ret=%i", dev->name, ret);
ehea_update_bcmc_registrations(); ehea_update_bcmc_registrations();
up(&ehea_bcmc_regs.lock); mutex_unlock(&ehea_bcmc_regs.lock);
ehea_update_firmware_handles(); ehea_update_firmware_handles();
mutex_unlock(&ehea_fw_handles.lock); mutex_unlock(&ehea_fw_handles.lock);
...@@ -2569,7 +2569,7 @@ static int ehea_down(struct net_device *dev) ...@@ -2569,7 +2569,7 @@ static int ehea_down(struct net_device *dev)
mutex_lock(&ehea_fw_handles.lock); mutex_lock(&ehea_fw_handles.lock);
down(&ehea_bcmc_regs.lock); mutex_lock(&ehea_bcmc_regs.lock);
ehea_drop_multicast_list(dev); ehea_drop_multicast_list(dev);
ehea_broadcast_reg_helper(port, H_DEREG_BCMC); ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
...@@ -2578,7 +2578,7 @@ static int ehea_down(struct net_device *dev) ...@@ -2578,7 +2578,7 @@ static int ehea_down(struct net_device *dev)
port->state = EHEA_PORT_DOWN; port->state = EHEA_PORT_DOWN;
ehea_update_bcmc_registrations(); ehea_update_bcmc_registrations();
up(&ehea_bcmc_regs.lock); mutex_unlock(&ehea_bcmc_regs.lock);
ret = ehea_clean_all_portres(port); ret = ehea_clean_all_portres(port);
if (ret) if (ret)
...@@ -3545,7 +3545,7 @@ int __init ehea_module_init(void) ...@@ -3545,7 +3545,7 @@ int __init ehea_module_init(void)
memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs)); memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs));
mutex_init(&ehea_fw_handles.lock); mutex_init(&ehea_fw_handles.lock);
sema_init(&ehea_bcmc_regs.lock, 1); mutex_init(&ehea_bcmc_regs.lock);
ret = check_module_parm(); ret = check_module_parm();
if (ret) if (ret)
......
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