aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/mmc_block.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-12-03 23:59:07 -0500
committerPaul Mackerras <paulus@samba.org>2006-12-03 23:59:07 -0500
commit79acbb3ff2d8095b692e1502b9eb2ccec348de26 (patch)
tree6ab773e5a8f9de2cd6443362b21d0d6fffe3b35e /drivers/mmc/mmc_block.c
parent19a79859e168640f8e16d7b216d211c1c52b687a (diff)
parent2b5f6dcce5bf94b9b119e9ed8d537098ec61c3d2 (diff)
Merge branch 'linux-2.6' into for-linus
Diffstat (limited to 'drivers/mmc/mmc_block.c')
-rw-r--r--drivers/mmc/mmc_block.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c
index f9027c8db792..87713572293f 100644
--- a/drivers/mmc/mmc_block.c
+++ b/drivers/mmc/mmc_block.c
@@ -83,7 +83,6 @@ static void mmc_blk_put(struct mmc_blk_data *md)
83 md->usage--; 83 md->usage--;
84 if (md->usage == 0) { 84 if (md->usage == 0) {
85 put_disk(md->disk); 85 put_disk(md->disk);
86 mmc_cleanup_queue(&md->queue);
87 kfree(md); 86 kfree(md);
88 } 87 }
89 mutex_unlock(&open_lock); 88 mutex_unlock(&open_lock);
@@ -225,10 +224,10 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
225 struct mmc_blk_data *md = mq->data; 224 struct mmc_blk_data *md = mq->data;
226 struct mmc_card *card = md->queue.card; 225 struct mmc_card *card = md->queue.card;
227 struct mmc_blk_request brq; 226 struct mmc_blk_request brq;
228 int ret; 227 int ret = 1;
229 228
230 if (mmc_card_claim_host(card)) 229 if (mmc_card_claim_host(card))
231 goto cmd_err; 230 goto flush_queue;
232 231
233 do { 232 do {
234 struct mmc_command cmd; 233 struct mmc_command cmd;
@@ -345,8 +344,6 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
345 return 1; 344 return 1;
346 345
347 cmd_err: 346 cmd_err:
348 ret = 1;
349
350 /* 347 /*
351 * If this is an SD card and we're writing, we can first 348 * If this is an SD card and we're writing, we can first
352 * mark the known good sectors as ok. 349 * mark the known good sectors as ok.
@@ -380,6 +377,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
380 377
381 mmc_card_release_host(card); 378 mmc_card_release_host(card);
382 379
380flush_queue:
383 spin_lock_irq(&md->lock); 381 spin_lock_irq(&md->lock);
384 while (ret) { 382 while (ret) {
385 ret = end_that_request_chunk(req, 0, 383 ret = end_that_request_chunk(req, 0,
@@ -553,12 +551,11 @@ static void mmc_blk_remove(struct mmc_card *card)
553 if (md) { 551 if (md) {
554 int devidx; 552 int devidx;
555 553
554 /* Stop new requests from getting into the queue */
556 del_gendisk(md->disk); 555 del_gendisk(md->disk);
557 556
558 /* 557 /* Then flush out any already in there */
559 * I think this is needed. 558 mmc_cleanup_queue(&md->queue);
560 */
561 md->disk->queue = NULL;
562 559
563 devidx = md->disk->first_minor >> MMC_SHIFT; 560 devidx = md->disk->first_minor >> MMC_SHIFT;
564 __clear_bit(devidx, dev_use); 561 __clear_bit(devidx, dev_use);