| From 1fc4f64704743974340c753ed4e016cd8fed1a57 Mon Sep 17 00:00:00 2001 |
| From: Paul Gortmaker <paul.gortmaker@windriver.com> |
| Date: Wed, 19 Jan 2011 22:17:23 -0500 |
| Subject: [PATCH] more semaphore_init removals |
| |
| This is one of several extractions from the merge up to 33-rc8. |
| |
| You can find the origin of this change in the tip merge commit: |
| |
| commit 5f854cfc024622e4aae14d7cf422f6ff86278688 |
| Merge: cc24da0 4ec62b2 |
| Author: Thomas Gleixner <tglx@linutronix.de> |
| Date: Sun Feb 21 20:17:22 2010 +0100 |
| |
| Forward to 2.6.33-rc8 |
| |
| Merge branch 'linus' into rt/head with a pile of conflicts. |
| |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| |
| Normally there are not significant changes/additions in a merge commit that |
| are not from any other "normal" commit. But in this case there are, so |
| break them out into separate explicit commits. |
| |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c |
| index 414a22e..c6273cc 100644 |
| --- a/arch/ia64/kernel/salinfo.c |
| +++ b/arch/ia64/kernel/salinfo.c |
| @@ -643,7 +643,7 @@ salinfo_init(void) |
| for (i = 0; i < ARRAY_SIZE(salinfo_log_name); i++) { |
| data = salinfo_data + i; |
| data->type = i; |
| - semaphore_init(&data->mutex); |
| + sema_init(&data->mutex, 1); |
| dir = proc_mkdir(salinfo_log_name[i], salinfo_dir); |
| if (!dir) |
| continue; |
| diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c |
| index 810a52c..8caa9e2 100644 |
| --- a/drivers/infiniband/core/user_mad.c |
| +++ b/drivers/infiniband/core/user_mad.c |
| @@ -1004,7 +1004,7 @@ static int ib_umad_init_port(struct ib_device *device, int port_num, |
| |
| port->ib_dev = device; |
| port->port_num = port_num; |
| - semaphore_init(&port->sm_sem); |
| + sema_init(&port->sm_sem, 1); |
| mutex_init(&port->file_mutex); |
| INIT_LIST_HEAD(&port->file_list); |
| |
| diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c |
| index 17920a9..e44f277 100644 |
| --- a/drivers/input/misc/hp_sdc_rtc.c |
| +++ b/drivers/input/misc/hp_sdc_rtc.c |
| @@ -53,7 +53,7 @@ MODULE_LICENSE("Dual BSD/GPL"); |
| |
| static unsigned long epoch = 2000; |
| |
| -static struct semaphore i8042tregs; |
| +static DEFINE_SEMAPHORE(i8042tregs, 1); |
| |
| static hp_sdc_irqhook hp_sdc_rtc_isr; |
| |
| @@ -83,7 +83,7 @@ static void hp_sdc_rtc_isr (int irq, void *dev_id, |
| |
| static int hp_sdc_rtc_do_read_bbrtc (struct rtc_time *rtctm) |
| { |
| - struct semaphore tsem; |
| + DEFINE_SEMAPHORE(tsem, 0); |
| hp_sdc_transaction t; |
| uint8_t tseq[91]; |
| int i; |
| @@ -103,8 +103,7 @@ static int hp_sdc_rtc_do_read_bbrtc (struct rtc_time *rtctm) |
| t.endidx = 91; |
| t.seq = tseq; |
| t.act.semaphore = &tsem; |
| - semaphore_init_locked(&tsem); |
| - |
| + |
| if (hp_sdc_enqueue_transaction(&t)) return -1; |
| |
| down_interruptible(&tsem); /* Put ourselves to sleep for results. */ |
| @@ -684,8 +683,6 @@ static int __init hp_sdc_rtc_init(void) |
| return -ENODEV; |
| #endif |
| |
| - semaphore_init(&i8042tregs); |
| - |
| if ((ret = hp_sdc_request_timer_irq(&hp_sdc_rtc_isr))) |
| return ret; |
| if (misc_register(&hp_sdc_rtc_dev) != 0) |
| diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c |
| index 290b648..9e78665 100644 |
| --- a/drivers/input/serio/hil_mlc.c |
| +++ b/drivers/input/serio/hil_mlc.c |
| @@ -914,15 +914,15 @@ int hil_mlc_register(hil_mlc *mlc) |
| mlc->ostarted = 0; |
| |
| rwlock_init(&mlc->lock); |
| - semaphore_init(&mlc->osem); |
| + sema_init(&mlc->osem, 1); |
| |
| - semaphore_init(&mlc->isem); |
| + sema_init(&mlc->isem, 1); |
| mlc->icount = -1; |
| mlc->imatch = 0; |
| |
| mlc->opercnt = 0; |
| |
| - semaphore_init(&(mlc->csem)); |
| + sema_init(&mlc->csem, 0); |
| |
| hil_mlc_clear_di_scratch(mlc); |
| hil_mlc_clear_di_map(mlc, 0); |
| diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c |
| index ff45419..997f9b6 100644 |
| --- a/drivers/input/serio/hp_sdc.c |
| +++ b/drivers/input/serio/hp_sdc.c |
| @@ -1039,7 +1039,7 @@ static int __init hp_sdc_register(void) |
| return hp_sdc.dev_err; |
| } |
| |
| - semaphore_init(&tq_init_sem); |
| + sema_init(&tq_init_sem, 0); |
| |
| tq_init.actidx = 0; |
| tq_init.idx = 1; |
| diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c |
| index 5bef6a9..a525eb8 100644 |
| --- a/drivers/mmc/card/queue.c |
| +++ b/drivers/mmc/card/queue.c |
| @@ -195,7 +195,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock |
| sg_init_table(mq->sg, host->max_phys_segs); |
| } |
| |
| - semaphore_init(&mq->thread_sem); |
| + sema_init(&mq->thread_sem, 1); |
| |
| mq->thread = kthread_run(mmc_queue_thread, mq, "mmcqd"); |
| if (IS_ERR(mq->thread)) { |
| diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c |
| index d20cb67..d5e0bdb 100644 |
| --- a/drivers/usb/misc/ftdi-elan.c |
| +++ b/drivers/usb/misc/ftdi-elan.c |
| @@ -2766,7 +2766,7 @@ static int ftdi_elan_probe(struct usb_interface *interface, |
| ftdi->sequence_num = ++ftdi_instances; |
| mutex_unlock(&ftdi_module_lock); |
| ftdi_elan_init_kref(ftdi); |
| - semaphore_init(&ftdi->sw_lock); |
| + sema_init(&ftdi->sw_lock, 1); |
| ftdi->udev = usb_get_dev(interface_to_usbdev(interface)); |
| ftdi->interface = interface; |
| mutex_init(&ftdi->u132_lock); |
| -- |
| 1.7.1 |
| |