staging: Final semaphore cleanup
authorThomas Gleixner <tglx@linutronix.de>
Sat, 30 Oct 2010 09:06:57 +0000 (11:06 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 30 Oct 2010 10:12:50 +0000 (12:12 +0200)
Fixup the last remaining users of DECLARE_MUTEX and init_MUTEX.

Scripted conversion, resulting code is binary equivalent.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
LKML-Reference: <20100907125057.278833764@linutronix.de>

15 files changed:
drivers/staging/ath6kl/os/linux/ar6000_raw_if.c
drivers/staging/brcm80211/brcmfmac/dhd_linux.c
drivers/staging/brcm80211/sys/wl_mac80211.c
drivers/staging/comedi/drivers/dt9812.c
drivers/staging/comedi/drivers/usbdux.c
drivers/staging/comedi/drivers/usbduxfast.c
drivers/staging/dream/camera/mt9d112.c
drivers/staging/dream/camera/mt9p012_fox.c
drivers/staging/dream/camera/mt9t013.c
drivers/staging/dream/camera/s5k3e2fx.c
drivers/staging/msm/msm_fb.c
drivers/staging/rtl8712/osdep_service.h
drivers/staging/smbfs/inode.c
drivers/staging/westbridge/astoria/block/cyasblkdev_block.c
drivers/staging/westbridge/astoria/block/cyasblkdev_queue.c

index c196098f0859c2aa1c60df2d2c9dcc1bd5957110..6b8eeea475cf4e9e5a59f9b0d821121229d4cea5 100644 (file)
@@ -198,8 +198,8 @@ int ar6000_htc_raw_open(AR_SOFTC_T *ar)
         
     for (streamID = HTC_RAW_STREAM_0; streamID < HTC_RAW_STREAM_NUM_MAX; streamID++) {
         /* Initialize the data structures */
-        init_MUTEX(&arRaw->raw_htc_read_sem[streamID]);
-        init_MUTEX(&arRaw->raw_htc_write_sem[streamID]);
+       sema_init(&arRaw->raw_htc_read_sem[streamID], 1);
+       sema_init(&arRaw->raw_htc_write_sem[streamID], 1);
         init_waitqueue_head(&arRaw->raw_htc_read_queue[streamID]);
         init_waitqueue_head(&arRaw->raw_htc_write_queue[streamID]);
 
index e5357875661f5227a4cdd81dbd3f6b2e53e20fb4..bbbe7c5f7492573508d5027b03cd1df9a187b561 100644 (file)
@@ -1929,7 +1929,7 @@ dhd_pub_t *dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
                goto fail;
 
        net->netdev_ops = NULL;
-       init_MUTEX(&dhd->proto_sem);
+       sema_init(&dhd->proto_sem, 1);
        /* Initialize other structure content */
        init_waitqueue_head(&dhd->ioctl_resp_wait);
        init_waitqueue_head(&dhd->ctrl_wait);
@@ -1977,7 +1977,7 @@ dhd_pub_t *dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
        dhd->timer.function = dhd_watchdog;
 
        /* Initialize thread based operation and lock */
-       init_MUTEX(&dhd->sdsem);
+       sema_init(&dhd->sdsem, 1);
        if ((dhd_watchdog_prio >= 0) && (dhd_dpc_prio >= 0))
                dhd->threads_only = true;
        else
index ad635ee7758e2aca45e3d6cb5d60d67c19c48618..d060377629ac2fc69320a17600a1371b201dec40 100644 (file)
@@ -866,7 +866,7 @@ static wl_info_t *wl_attach(u16 vendor, u16 device, unsigned long regs,
        spin_lock_init(&wl->rpcq_lock);
        spin_lock_init(&wl->txq_lock);
 
-       init_MUTEX(&wl->sem);
+       sema_init(&wl->sem, 1);
 #else
        spin_lock_init(&wl->lock);
        spin_lock_init(&wl->isr_lock);
index 0560a74515125c6668e225ab433987b91dd4e365..06059850dae2e3d2b7a4d06e16a9337c2cfefab4 100644 (file)
@@ -262,7 +262,7 @@ struct dt9812_usb_cmd {
 
 #define DT9812_NUM_SLOTS       16
 
-static DECLARE_MUTEX(dt9812_mutex);
+static DEFINE_SEMAPHORE(dt9812_mutex);
 
 static const struct usb_device_id dt9812_table[] = {
        {USB_DEVICE(0x0867, 0x9812)},
index 6131e2dd0591ba60b38c6b7cc755e326e5382123..1f177a67ff114f9098f3bcdb282068978c6567e3 100644 (file)
@@ -315,7 +315,7 @@ struct usbduxsub {
  */
 static struct usbduxsub usbduxsub[NUMUSBDUX];
 
-static DECLARE_MUTEX(start_stop_sem);
+static DEFINE_SEMAPHORE(start_stop_sem);
 
 /*
  * Stops the data acquision
@@ -2367,7 +2367,7 @@ static int usbduxsub_probe(struct usb_interface *uinterf,
        dev_dbg(dev, "comedi_: usbdux: "
                "usbduxsub[%d] is ready to connect to comedi.\n", index);
 
-       init_MUTEX(&(usbduxsub[index].sem));
+       sema_init(&(usbduxsub[index].sem), 1);
        /* save a pointer to the usb device */
        usbduxsub[index].usbdev = udev;
 
index 0a164a9a66c3b0024890b61a76e0178abf576023..5b15e6df54e653cb4f7e815979c0c7f645722a23 100644 (file)
@@ -199,7 +199,7 @@ struct usbduxfastsub_s {
  */
 static struct usbduxfastsub_s usbduxfastsub[NUMUSBDUXFAST];
 
-static DECLARE_MUTEX(start_stop_sem);
+static DEFINE_SEMAPHORE(start_stop_sem);
 
 /*
  * bulk transfers to usbduxfast
@@ -1504,7 +1504,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf,
               "connect to comedi.\n", index);
 #endif
 
-       init_MUTEX(&(usbduxfastsub[index].sem));
+       sema_init(&(usbduxfastsub[index].sem), 1);
        /* save a pointer to the usb device */
        usbduxfastsub[index].usbdev = udev;
 
index e6f2d5124611d2202c608ed8b160d76274711cf6..27c978f8a6cd39c9608303d6aae34f65a9aad1e0 100644 (file)
@@ -37,7 +37,7 @@ struct mt9d112_ctrl {
 static struct mt9d112_ctrl *mt9d112_ctrl;
 
 static DECLARE_WAIT_QUEUE_HEAD(mt9d112_wait_queue);
-DECLARE_MUTEX(mt9d112_sem);
+DEFINE_SEMAPHORE(mt9d112_sem);
 
 
 /*=============================================================
index 791bd6c406154e5d82c1e9cc914b90938099d204..544a9732b59219540bc82831074fbf967e358352 100644 (file)
@@ -123,7 +123,7 @@ struct mt9p012_ctrl {
 
 static struct mt9p012_ctrl *mt9p012_ctrl;
 static DECLARE_WAIT_QUEUE_HEAD(mt9p012_wait_queue);
-DECLARE_MUTEX(mt9p012_sem);
+DEFINE_SEMAPHORE(mt9p012_sem);
 
 /*=============================================================
        EXTERNAL DECLARATIONS
index 8fd7727ba234ee6636205f08e02a4a7f3080d051..75e78aa528201765d0fb8a7963fac22c63d64e0c 100644 (file)
@@ -123,7 +123,7 @@ struct mt9t013_ctrl {
 
 static struct mt9t013_ctrl *mt9t013_ctrl;
 static DECLARE_WAIT_QUEUE_HEAD(mt9t013_wait_queue);
-DECLARE_MUTEX(mt9t013_sem);
+DEFINE_SEMAPHORE(mt9t013_sem);
 
 extern struct mt9t013_reg mt9t013_regs; /* from mt9t013_reg.c */
 
index 1459903a339d40d9fbb1d8b1d6669811da08b38b..d66b453b0672224b4203423c36c36a17efe3c081 100644 (file)
@@ -313,7 +313,7 @@ struct s5k3e2fx_i2c_reg_conf {
 
 static struct s5k3e2fx_ctrl *s5k3e2fx_ctrl;
 static DECLARE_WAIT_QUEUE_HEAD(s5k3e2fx_wait_queue);
-DECLARE_MUTEX(s5k3e2fx_sem);
+DEFINE_SEMAPHORE(s5k3e2fx_sem);
 
 static int s5k3e2fx_i2c_rxdata(unsigned short saddr, unsigned char *rxdata,
        int length)
index ea268edbf43b0916be95f4e0d5f20b38665a05fb..23fa049b51f22d941ebd8415f375c93ad3462898 100644 (file)
@@ -1158,7 +1158,7 @@ static int msm_fb_release(struct fb_info *info, int user)
        return ret;
 }
 
-DECLARE_MUTEX(msm_fb_pan_sem);
+DEFINE_SEMAPHORE(msm_fb_pan_sem);
 
 static int msm_fb_pan_display(struct fb_var_screeninfo *var,
                              struct fb_info *info)
@@ -1962,7 +1962,7 @@ static int msmfb_overlay_play(struct fb_info *info, unsigned long *argp)
 
 #endif
 
-DECLARE_MUTEX(msm_fb_ioctl_ppp_sem);
+DEFINE_SEMAPHORE(msm_fb_ioctl_ppp_sem);
 DEFINE_MUTEX(msm_fb_ioctl_lut_sem);
 DEFINE_MUTEX(msm_fb_ioctl_hist_sem);
 
index 7fca42c7c0d40f9b0d103f8a3f93f789828d0b68..d1674cd282dcd7deb370cca6b75c8f0f69b3ed73 100644 (file)
@@ -161,7 +161,7 @@ static inline u32 _down_sema(struct semaphore *sema)
 
 static inline void _rtl_rwlock_init(struct semaphore *prwlock)
 {
-       init_MUTEX(prwlock);
+       sema_init(prwlock, 1);
 }
 
 static inline void _init_listhead(struct list_head *list)
index 552951aa749834ebc9d61baa4368d066e9f858ef..fa42f40fa2266cc41cd4e20b371d1d7fddc8c44e 100644 (file)
@@ -537,7 +537,7 @@ static int smb_fill_super(struct super_block *sb, void *raw_data, int silent)
        server->mnt = NULL;
        server->sock_file = NULL;
        init_waitqueue_head(&server->conn_wq);
-       init_MUTEX(&server->sem);
+       sema_init(&server->sem, 1);
        INIT_LIST_HEAD(&server->entry);
        INIT_LIST_HEAD(&server->xmitq);
        INIT_LIST_HEAD(&server->recvq);
index f428a7af357a6812fe1f0c7ca8f73a7f88aecf24..e1851f00be568f07e17fbd6c45070bdc9d01de93 100644 (file)
@@ -157,7 +157,7 @@ struct cyasblkdev_blk_data {
 /* pointer to west bridge block data device superstructure */
 static struct cyasblkdev_blk_data *gl_bd;
 
-static DECLARE_MUTEX(open_lock);
+static DEFINE_SEMAPHORE(open_lock);
 
 /* local forwardd declarationss  */
 static cy_as_device_handle *cyas_dev_handle;
index 24e959eca4127a0db1078a60466723d569304be5..0bbb8a3e191df18963e98bafeaef480da125a3a2 100644 (file)
@@ -334,7 +334,7 @@ int cyasblkdev_init_queue(struct cyasblkdev_queue *bq, spinlock_t *lock)
 
        init_completion(&bq->thread_complete);
        init_waitqueue_head(&bq->thread_wq);
-       init_MUTEX(&bq->thread_sem);
+       sema_init(&bq->thread_sem, 1);
 
        ret = kernel_thread(cyasblkdev_queue_thread, bq, CLONE_KERNEL);
        if (ret >= 0) {