Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74078
b: refs/heads/master
c: 1dff314
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse authored and Pierre Ossman committed Nov 21, 2007
1 parent 7649ad5 commit a1a52b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b37a05069b9ab9fb1e52393a3448d710c50c54d5
refs/heads/master: 1dff314451fa24d6b107aa05393d3169e56a7e0a
14 changes: 6 additions & 8 deletions trunk/drivers/mmc/card/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
* max 8 partitions per card
*/
#define MMC_SHIFT 3
#define MMC_NUM_MINORS (256 >> MMC_SHIFT)

static unsigned long dev_use[MMC_NUM_MINORS/(8*sizeof(unsigned long))];

/*
* There is one mmc_blk_data per slot.
Expand Down Expand Up @@ -80,6 +83,9 @@ static void mmc_blk_put(struct mmc_blk_data *md)
mutex_lock(&open_lock);
md->usage--;
if (md->usage == 0) {
int devidx = md->disk->first_minor >> MMC_SHIFT;
__clear_bit(devidx, dev_use);

put_disk(md->disk);
kfree(md);
}
Expand Down Expand Up @@ -406,9 +412,6 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
return 0;
}

#define MMC_NUM_MINORS (256 >> MMC_SHIFT)

static unsigned long dev_use[MMC_NUM_MINORS/(8*sizeof(unsigned long))];

static inline int mmc_blk_readonly(struct mmc_card *card)
{
Expand Down Expand Up @@ -574,17 +577,12 @@ static void mmc_blk_remove(struct mmc_card *card)
struct mmc_blk_data *md = mmc_get_drvdata(card);

if (md) {
int devidx;

/* Stop new requests from getting into the queue */
del_gendisk(md->disk);

/* Then flush out any already in there */
mmc_cleanup_queue(&md->queue);

devidx = md->disk->first_minor >> MMC_SHIFT;
__clear_bit(devidx, dev_use);

mmc_blk_put(md);
}
mmc_set_drvdata(card, NULL);
Expand Down

0 comments on commit a1a52b3

Please sign in to comment.