mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[PATCH] sem2mutex: misc static one-file mutexes
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <[email protected]> Cc: Dave Jones <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Neil Brown <[email protected]> Acked-by: Alasdair G Kergon <[email protected]> Cc: Greg KH <[email protected]> Cc: Dominik Brodowski <[email protected]> Cc: Adam Belay <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: "David S. Miller" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
353ab6e97b
commit
14cc3e2b63
20 changed files with 172 additions and 157 deletions
|
|
@ -19,7 +19,7 @@
|
|||
#include <linux/string.h>
|
||||
|
||||
#include <asm/pci-bridge.h>
|
||||
#include <asm/semaphore.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <asm/rtas.h>
|
||||
#include <asm/vio.h>
|
||||
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
#include "rpaphp.h"
|
||||
#include "rpadlpar.h"
|
||||
|
||||
static DECLARE_MUTEX(rpadlpar_sem);
|
||||
static DEFINE_MUTEX(rpadlpar_mutex);
|
||||
|
||||
#define DLPAR_MODULE_NAME "rpadlpar_io"
|
||||
|
||||
|
|
@ -300,7 +300,7 @@ int dlpar_add_slot(char *drc_name)
|
|||
int node_type;
|
||||
int rc = -EIO;
|
||||
|
||||
if (down_interruptible(&rpadlpar_sem))
|
||||
if (mutex_lock_interruptible(&rpadlpar_mutex))
|
||||
return -ERESTARTSYS;
|
||||
|
||||
/* Find newly added node */
|
||||
|
|
@ -324,7 +324,7 @@ int dlpar_add_slot(char *drc_name)
|
|||
|
||||
printk(KERN_INFO "%s: slot %s added\n", DLPAR_MODULE_NAME, drc_name);
|
||||
exit:
|
||||
up(&rpadlpar_sem);
|
||||
mutex_unlock(&rpadlpar_mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -417,7 +417,7 @@ int dlpar_remove_slot(char *drc_name)
|
|||
int node_type;
|
||||
int rc = 0;
|
||||
|
||||
if (down_interruptible(&rpadlpar_sem))
|
||||
if (mutex_lock_interruptible(&rpadlpar_mutex))
|
||||
return -ERESTARTSYS;
|
||||
|
||||
dn = find_dlpar_node(drc_name, &node_type);
|
||||
|
|
@ -439,7 +439,7 @@ int dlpar_remove_slot(char *drc_name)
|
|||
}
|
||||
printk(KERN_INFO "%s: slot %s removed\n", DLPAR_MODULE_NAME, drc_name);
|
||||
exit:
|
||||
up(&rpadlpar_sem);
|
||||
mutex_unlock(&rpadlpar_mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include <linux/pci.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
#include <asm/sn/addrs.h>
|
||||
#include <asm/sn/l1.h>
|
||||
|
|
@ -81,7 +82,7 @@ static struct hotplug_slot_ops sn_hotplug_slot_ops = {
|
|||
.get_power_status = get_power_status,
|
||||
};
|
||||
|
||||
static DECLARE_MUTEX(sn_hotplug_sem);
|
||||
static DEFINE_MUTEX(sn_hotplug_mutex);
|
||||
|
||||
static ssize_t path_show (struct hotplug_slot *bss_hotplug_slot,
|
||||
char *buf)
|
||||
|
|
@ -346,7 +347,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
|
|||
int rc;
|
||||
|
||||
/* Serialize the Linux PCI infrastructure */
|
||||
down(&sn_hotplug_sem);
|
||||
mutex_lock(&sn_hotplug_mutex);
|
||||
|
||||
/*
|
||||
* Power-on and initialize the slot in the SN
|
||||
|
|
@ -354,7 +355,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
|
|||
*/
|
||||
rc = sn_slot_enable(bss_hotplug_slot, slot->device_num);
|
||||
if (rc) {
|
||||
up(&sn_hotplug_sem);
|
||||
mutex_unlock(&sn_hotplug_mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -362,7 +363,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
|
|||
PCI_DEVFN(slot->device_num + 1, 0));
|
||||
if (!num_funcs) {
|
||||
dev_dbg(slot->pci_bus->self, "no device in slot\n");
|
||||
up(&sn_hotplug_sem);
|
||||
mutex_unlock(&sn_hotplug_mutex);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
|
@ -402,7 +403,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
|
|||
if (new_ppb)
|
||||
pci_bus_add_devices(new_bus);
|
||||
|
||||
up(&sn_hotplug_sem);
|
||||
mutex_unlock(&sn_hotplug_mutex);
|
||||
|
||||
if (rc == 0)
|
||||
dev_dbg(slot->pci_bus->self,
|
||||
|
|
@ -422,7 +423,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
|
|||
int rc;
|
||||
|
||||
/* Acquire update access to the bus */
|
||||
down(&sn_hotplug_sem);
|
||||
mutex_lock(&sn_hotplug_mutex);
|
||||
|
||||
/* is it okay to bring this slot down? */
|
||||
rc = sn_slot_disable(bss_hotplug_slot, slot->device_num,
|
||||
|
|
@ -450,7 +451,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
|
|||
PCI_REQ_SLOT_DISABLE);
|
||||
leaving:
|
||||
/* Release the bus lock */
|
||||
up(&sn_hotplug_sem);
|
||||
mutex_unlock(&sn_hotplug_mutex);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -462,9 +463,9 @@ static inline int get_power_status(struct hotplug_slot *bss_hotplug_slot,
|
|||
struct pcibus_info *pcibus_info;
|
||||
|
||||
pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus);
|
||||
down(&sn_hotplug_sem);
|
||||
mutex_lock(&sn_hotplug_mutex);
|
||||
*value = pcibus_info->pbi_enabled_devices & (1 << slot->device_num);
|
||||
up(&sn_hotplug_sem);
|
||||
mutex_unlock(&sn_hotplug_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue