/* Initialize all driver slots */
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].usb = NULL;
dt9812[i].comedi = NULL;
switch (state)
{
case SEM_TAKEN:
- init_MUTEX_LOCKED ((struct semaphore *) sem);
+ sema_init((struct semaphore *) sem, 0);
break;
case SEM_AVAILABLE:
- init_MUTEX ((struct semaphore *) sem);
+ sema_init((struct semaphore *) sem, 1);
break;
default: /* otherwise, set sem.count to state's
* value */
pmem[id].ioctl = ioctl;
pmem[id].release = release;
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);
pmem[id].dev.name = pdata->name;
pmem[id].dev.minor = id;
mddi_host_initialized = TRUE;
- init_MUTEX(&mddi_host_mutex);
+ sema_init(&mddi_host_mutex, 1);
if (!mddi_host_powered) {
down(&mddi_host_mutex);
/* initialize semaphore */
init_completion(&mdp_ppp_comp);
- init_MUTEX(&mdp_ppp_mutex);
- init_MUTEX(&mdp_pipe_ctrl_mutex);
+ sema_init(&mdp_ppp_mutex, 1);
+ sema_init(&mdp_pipe_ctrl_mutex, 1);
dma2_data.busy = FALSE;
dma2_data.waiting = FALSE;
init_completion(&dma2_data.comp);
- init_MUTEX(&dma2_data.mutex);
+ sema_init(&dma2_data.mutex, 1);
mutex_init(&dma2_data.ov_mutex);
dma3_data.busy = FALSE;
dma3_data.waiting = FALSE;
init_completion(&dma3_data.comp);
- init_MUTEX(&dma3_data.mutex);
+ sema_init(&dma3_data.mutex, 1);
dma_s_data.busy = FALSE;
dma_s_data.waiting = FALSE;
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.waiting = FALSE;
mfd->pan_waiting = FALSE;
init_completion(&mfd->pan_comp);
init_completion(&mfd->refresher_comp);
- init_MUTEX(&mfd->sem);
+ sema_init(&mfd->sem, 1);
fbram_offset = PAGE_ALIGN((int)fbram)-(int)fbram;
fbram += fbram_offset;
/* Create Mutex and keventd */
INIT_WORK(&macp->kevent, kevent);
- init_MUTEX(&macp->ioctl_sem);
+ sema_init(&macp->ioctl_sem, 1);
return 0;
}
("STA Driver version-%s\n", STA_DRIVER_VERSION));
#ifdef RTMP_MAC_USB
- init_MUTEX(&(pAd->UsbVendorReq_semaphore));
+ sema_init(&(pAd->UsbVendorReq_semaphore), 1);
os_alloc_mem(pAd, (u8 **) & pAd->UsbVendorReqBuf,
MAX_PARAM_BUFFER_SIZE - 1);
if (pAd->UsbVendorReqBuf == NULL) {
solo_dev->i2c_id = -1;
solo_dev->i2c_state = IIC_STATE_IDLE;
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++) {
struct i2c_adapter *adap = &solo_dev->i2c_adap[i];
for (i = 0; i < SOLO_NR_P2M; i++) {
p2m_dev = &solo_dev->p2m_dev[i];
- init_MUTEX(&p2m_dev->sem);
+ sema_init(&p2m_dev->sem, 1);
init_completion(&p2m_dev->completion);
solo_reg_write(solo_dev, SOLO_P2M_DES_ADR(i),
for (i = 0; i < VME_DEVS; i++) {
image[i].kern_buf = NULL;
image[i].pci_buf = 0;
- init_MUTEX(&(image[i].sem));
+ sema_init(&(image[i].sem), 1);
image[i].device = NULL;
image[i].resource = NULL;
image[i].users = 0;