]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/mmc/card/queue.c
mmc: Convert "mutex" to semaphore
[karo-tx-linux.git] / drivers / mmc / card / queue.c
index 9c0b42bfe0898be59cb8210b6e57dcc6a47ec448..91c99e76c8cc903f1b363aefb68e050907bb516d 100644 (file)
@@ -146,7 +146,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
        }
 
 #ifdef CONFIG_MMC_BLOCK_BOUNCE
-       if (host->max_hw_segs == 1) {
+       if (host->max_segs == 1) {
                unsigned int bouncesz;
 
                bouncesz = MMC_QUEUE_BOUNCESZ;
@@ -196,19 +196,19 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
                blk_queue_bounce_limit(mq->queue, limit);
                blk_queue_max_hw_sectors(mq->queue,
                        min(host->max_blk_count, host->max_req_size / 512));
-               blk_queue_max_segments(mq->queue, host->max_hw_segs);
+               blk_queue_max_segments(mq->queue, host->max_segs);
                blk_queue_max_segment_size(mq->queue, host->max_seg_size);
 
                mq->sg = kmalloc(sizeof(struct scatterlist) *
-                       host->max_phys_segs, GFP_KERNEL);
+                       host->max_segs, GFP_KERNEL);
                if (!mq->sg) {
                        ret = -ENOMEM;
                        goto cleanup_queue;
                }
-               sg_init_table(mq->sg, host->max_phys_segs);
+               sg_init_table(mq->sg, host->max_segs);
        }
 
-       init_MUTEX(&mq->thread_sem);
+       sema_init(&mq->thread_sem, 1);
 
        mq->thread = kthread_run(mmc_queue_thread, mq, "mmcqd");
        if (IS_ERR(mq->thread)) {