mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
staging: Bulk convert the semaphore mess
init_MUTEX(_LOCKED) and DECLARE_MUTEX are going away. Bulk convert staging users. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
d6835e8417
commit
0f0800f17a
11 changed files with 16 additions and 16 deletions
|
@ -1128,7 +1128,7 @@ static int __init usb_dt9812_init(void)
|
||||||
|
|
||||||
/* Initialize all driver slots */
|
/* Initialize all driver slots */
|
||||||
for (i = 0; i < DT9812_NUM_SLOTS; i++) {
|
for (i = 0; i < DT9812_NUM_SLOTS; i++) {
|
||||||
init_MUTEX(&dt9812[i].mutex);
|
sema_init(&dt9812[i].mutex, 1);
|
||||||
dt9812[i].serial = 0;
|
dt9812[i].serial = 0;
|
||||||
dt9812[i].usb = NULL;
|
dt9812[i].usb = NULL;
|
||||||
dt9812[i].comedi = NULL;
|
dt9812[i].comedi = NULL;
|
||||||
|
|
|
@ -184,10 +184,10 @@ OS_sem_init (void *sem, int state)
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case SEM_TAKEN:
|
case SEM_TAKEN:
|
||||||
init_MUTEX_LOCKED ((struct semaphore *) sem);
|
sema_init((struct semaphore *) sem, 0);
|
||||||
break;
|
break;
|
||||||
case SEM_AVAILABLE:
|
case SEM_AVAILABLE:
|
||||||
init_MUTEX ((struct semaphore *) sem);
|
sema_init((struct semaphore *) sem, 1);
|
||||||
break;
|
break;
|
||||||
default: /* otherwise, set sem.count to state's
|
default: /* otherwise, set sem.count to state's
|
||||||
* value */
|
* value */
|
||||||
|
|
|
@ -1231,7 +1231,7 @@ int pmem_setup(struct android_pmem_platform_data *pdata,
|
||||||
pmem[id].ioctl = ioctl;
|
pmem[id].ioctl = ioctl;
|
||||||
pmem[id].release = release;
|
pmem[id].release = release;
|
||||||
init_rwsem(&pmem[id].bitmap_sem);
|
init_rwsem(&pmem[id].bitmap_sem);
|
||||||
init_MUTEX(&pmem[id].data_list_sem);
|
sema_init(&pmem[id].data_list_sem, 1);
|
||||||
INIT_LIST_HEAD(&pmem[id].data_list);
|
INIT_LIST_HEAD(&pmem[id].data_list);
|
||||||
pmem[id].dev.name = pdata->name;
|
pmem[id].dev.name = pdata->name;
|
||||||
pmem[id].dev.minor = id;
|
pmem[id].dev.minor = id;
|
||||||
|
|
|
@ -67,7 +67,7 @@ void mddi_init(void)
|
||||||
|
|
||||||
mddi_host_initialized = TRUE;
|
mddi_host_initialized = TRUE;
|
||||||
|
|
||||||
init_MUTEX(&mddi_host_mutex);
|
sema_init(&mddi_host_mutex, 1);
|
||||||
|
|
||||||
if (!mddi_host_powered) {
|
if (!mddi_host_powered) {
|
||||||
down(&mddi_host_mutex);
|
down(&mddi_host_mutex);
|
||||||
|
|
|
@ -669,24 +669,24 @@ static void mdp_drv_init(void)
|
||||||
|
|
||||||
/* initialize semaphore */
|
/* initialize semaphore */
|
||||||
init_completion(&mdp_ppp_comp);
|
init_completion(&mdp_ppp_comp);
|
||||||
init_MUTEX(&mdp_ppp_mutex);
|
sema_init(&mdp_ppp_mutex, 1);
|
||||||
init_MUTEX(&mdp_pipe_ctrl_mutex);
|
sema_init(&mdp_pipe_ctrl_mutex, 1);
|
||||||
|
|
||||||
dma2_data.busy = FALSE;
|
dma2_data.busy = FALSE;
|
||||||
dma2_data.waiting = FALSE;
|
dma2_data.waiting = FALSE;
|
||||||
init_completion(&dma2_data.comp);
|
init_completion(&dma2_data.comp);
|
||||||
init_MUTEX(&dma2_data.mutex);
|
sema_init(&dma2_data.mutex, 1);
|
||||||
mutex_init(&dma2_data.ov_mutex);
|
mutex_init(&dma2_data.ov_mutex);
|
||||||
|
|
||||||
dma3_data.busy = FALSE;
|
dma3_data.busy = FALSE;
|
||||||
dma3_data.waiting = FALSE;
|
dma3_data.waiting = FALSE;
|
||||||
init_completion(&dma3_data.comp);
|
init_completion(&dma3_data.comp);
|
||||||
init_MUTEX(&dma3_data.mutex);
|
sema_init(&dma3_data.mutex, 1);
|
||||||
|
|
||||||
dma_s_data.busy = FALSE;
|
dma_s_data.busy = FALSE;
|
||||||
dma_s_data.waiting = FALSE;
|
dma_s_data.waiting = FALSE;
|
||||||
init_completion(&dma_s_data.comp);
|
init_completion(&dma_s_data.comp);
|
||||||
init_MUTEX(&dma_s_data.mutex);
|
sema_init(&dma_s_data.mutex, 1);
|
||||||
|
|
||||||
dma_e_data.busy = FALSE;
|
dma_e_data.busy = FALSE;
|
||||||
dma_e_data.waiting = FALSE;
|
dma_e_data.waiting = FALSE;
|
||||||
|
|
|
@ -915,7 +915,7 @@ static int msm_fb_register(struct msm_fb_data_type *mfd)
|
||||||
mfd->pan_waiting = FALSE;
|
mfd->pan_waiting = FALSE;
|
||||||
init_completion(&mfd->pan_comp);
|
init_completion(&mfd->pan_comp);
|
||||||
init_completion(&mfd->refresher_comp);
|
init_completion(&mfd->refresher_comp);
|
||||||
init_MUTEX(&mfd->sem);
|
sema_init(&mfd->sem, 1);
|
||||||
|
|
||||||
fbram_offset = PAGE_ALIGN((int)fbram)-(int)fbram;
|
fbram_offset = PAGE_ALIGN((int)fbram)-(int)fbram;
|
||||||
fbram += fbram_offset;
|
fbram += fbram_offset;
|
||||||
|
|
|
@ -985,7 +985,7 @@ u8_t zfLnxCreateThread(zdev_t *dev)
|
||||||
|
|
||||||
/* Create Mutex and keventd */
|
/* Create Mutex and keventd */
|
||||||
INIT_WORK(&macp->kevent, kevent);
|
INIT_WORK(&macp->kevent, kevent);
|
||||||
init_MUTEX(&macp->ioctl_sem);
|
sema_init(&macp->ioctl_sem, 1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3509,7 +3509,7 @@ int RtmpRaDevCtrlInit(struct rt_rtmp_adapter *pAd, IN RTMP_INF_TYPE infType)
|
||||||
("STA Driver version-%s\n", STA_DRIVER_VERSION));
|
("STA Driver version-%s\n", STA_DRIVER_VERSION));
|
||||||
|
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
init_MUTEX(&(pAd->UsbVendorReq_semaphore));
|
sema_init(&(pAd->UsbVendorReq_semaphore), 1);
|
||||||
os_alloc_mem(pAd, (u8 **) & pAd->UsbVendorReqBuf,
|
os_alloc_mem(pAd, (u8 **) & pAd->UsbVendorReqBuf,
|
||||||
MAX_PARAM_BUFFER_SIZE - 1);
|
MAX_PARAM_BUFFER_SIZE - 1);
|
||||||
if (pAd->UsbVendorReqBuf == NULL) {
|
if (pAd->UsbVendorReqBuf == NULL) {
|
||||||
|
|
|
@ -284,7 +284,7 @@ int solo_i2c_init(struct solo6010_dev *solo_dev)
|
||||||
solo_dev->i2c_id = -1;
|
solo_dev->i2c_id = -1;
|
||||||
solo_dev->i2c_state = IIC_STATE_IDLE;
|
solo_dev->i2c_state = IIC_STATE_IDLE;
|
||||||
init_waitqueue_head(&solo_dev->i2c_wait);
|
init_waitqueue_head(&solo_dev->i2c_wait);
|
||||||
init_MUTEX(&solo_dev->i2c_sem);
|
sema_init(&solo_dev->i2c_sem, 1);
|
||||||
|
|
||||||
for (i = 0; i < SOLO_I2C_ADAPTERS; i++) {
|
for (i = 0; i < SOLO_I2C_ADAPTERS; i++) {
|
||||||
struct i2c_adapter *adap = &solo_dev->i2c_adap[i];
|
struct i2c_adapter *adap = &solo_dev->i2c_adap[i];
|
||||||
|
|
|
@ -188,7 +188,7 @@ int solo_p2m_init(struct solo6010_dev *solo_dev)
|
||||||
for (i = 0; i < SOLO_NR_P2M; i++) {
|
for (i = 0; i < SOLO_NR_P2M; i++) {
|
||||||
p2m_dev = &solo_dev->p2m_dev[i];
|
p2m_dev = &solo_dev->p2m_dev[i];
|
||||||
|
|
||||||
init_MUTEX(&p2m_dev->sem);
|
sema_init(&p2m_dev->sem, 1);
|
||||||
init_completion(&p2m_dev->completion);
|
init_completion(&p2m_dev->completion);
|
||||||
|
|
||||||
solo_reg_write(solo_dev, SOLO_P2M_DES_ADR(i),
|
solo_reg_write(solo_dev, SOLO_P2M_DES_ADR(i),
|
||||||
|
|
|
@ -683,7 +683,7 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
|
||||||
for (i = 0; i < VME_DEVS; i++) {
|
for (i = 0; i < VME_DEVS; i++) {
|
||||||
image[i].kern_buf = NULL;
|
image[i].kern_buf = NULL;
|
||||||
image[i].pci_buf = 0;
|
image[i].pci_buf = 0;
|
||||||
init_MUTEX(&(image[i].sem));
|
sema_init(&(image[i].sem), 1);
|
||||||
image[i].device = NULL;
|
image[i].device = NULL;
|
||||||
image[i].resource = NULL;
|
image[i].resource = NULL;
|
||||||
image[i].users = 0;
|
image[i].users = 0;
|
||||||
|
|
Loading…
Reference in a new issue