Skip to content

Commit 906c3b7

Browse files
rostedtIngo Molnar
authored andcommitted
[PATCH] mutex subsystem, semaphore to completion: SX8
change SX8 semaphores to completions. Signed-off-by: Ingo Molnar <[email protected]>
1 parent 7892f2f commit 906c3b7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/block/sx8.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
#include <linux/time.h>
2828
#include <linux/hdreg.h>
2929
#include <linux/dma-mapping.h>
30+
#include <linux/completion.h>
3031
#include <asm/io.h>
31-
#include <asm/semaphore.h>
3232
#include <asm/uaccess.h>
3333

3434
#if 0
@@ -303,7 +303,7 @@ struct carm_host {
303303

304304
struct work_struct fsm_task;
305305

306-
struct semaphore probe_sem;
306+
struct completion probe_comp;
307307
};
308308

309309
struct carm_response {
@@ -1346,7 +1346,7 @@ static void carm_fsm_task (void *_data)
13461346
}
13471347

13481348
case HST_PROBE_FINISHED:
1349-
up(&host->probe_sem);
1349+
complete(&host->probe_comp);
13501350
break;
13511351

13521352
case HST_ERROR:
@@ -1622,7 +1622,7 @@ static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
16221622
host->flags = pci_dac ? FL_DAC : 0;
16231623
spin_lock_init(&host->lock);
16241624
INIT_WORK(&host->fsm_task, carm_fsm_task, host);
1625-
init_MUTEX_LOCKED(&host->probe_sem);
1625+
init_completion(&host->probe_comp);
16261626

16271627
for (i = 0; i < ARRAY_SIZE(host->req); i++)
16281628
host->req[i].tag = i;
@@ -1691,8 +1691,8 @@ static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
16911691
if (rc)
16921692
goto err_out_free_irq;
16931693

1694-
DPRINTK("waiting for probe_sem\n");
1695-
down(&host->probe_sem);
1694+
DPRINTK("waiting for probe_comp\n");
1695+
wait_for_completion(&host->probe_comp);
16961696

16971697
printk(KERN_INFO "%s: pci %s, ports %d, io %lx, irq %u, major %d\n",
16981698
host->name, pci_name(pdev), (int) CARM_MAX_PORTS,

0 commit comments

Comments
 (0)