diff options
author | Pierre Ossman <drzeus@drzeus.cx> | 2006-12-26 09:11:23 -0500 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2007-02-04 14:54:06 -0500 |
commit | f22ee4edf63e7480511112d9965c71e07be3f8b7 (patch) | |
tree | 2fd5b00cf973804c128b59eddb5b27b5492881d7 /drivers/mmc/mmc.c | |
parent | 279bc4450989215e741c2c9d3a726f1ac96ede40 (diff) |
mmc: replace host->card_busy
As card_busy was only used to indicate if the host was exclusively
claimed and not really used to identify a particular card, replacing
it with just a boolean makes things a lot more easily understandable.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/mmc.c')
-rw-r--r-- | drivers/mmc/mmc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 6f2a282e2b97..105f419d08cb 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c | |||
@@ -103,7 +103,7 @@ mmc_start_request(struct mmc_host *host, struct mmc_request *mrq) | |||
103 | mmc_hostname(host), mrq->cmd->opcode, | 103 | mmc_hostname(host), mrq->cmd->opcode, |
104 | mrq->cmd->arg, mrq->cmd->flags); | 104 | mrq->cmd->arg, mrq->cmd->flags); |
105 | 105 | ||
106 | WARN_ON(host->card_busy == NULL); | 106 | WARN_ON(!host->claimed); |
107 | 107 | ||
108 | mrq->cmd->error = 0; | 108 | mrq->cmd->error = 0; |
109 | mrq->cmd->mrq = mrq; | 109 | mrq->cmd->mrq = mrq; |
@@ -157,7 +157,7 @@ int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd, int retries | |||
157 | { | 157 | { |
158 | struct mmc_request mrq; | 158 | struct mmc_request mrq; |
159 | 159 | ||
160 | BUG_ON(host->card_busy == NULL); | 160 | BUG_ON(!host->claimed); |
161 | 161 | ||
162 | memset(&mrq, 0, sizeof(struct mmc_request)); | 162 | memset(&mrq, 0, sizeof(struct mmc_request)); |
163 | 163 | ||
@@ -195,7 +195,7 @@ int mmc_wait_for_app_cmd(struct mmc_host *host, unsigned int rca, | |||
195 | 195 | ||
196 | int i, err; | 196 | int i, err; |
197 | 197 | ||
198 | BUG_ON(host->card_busy == NULL); | 198 | BUG_ON(!host->claimed); |
199 | BUG_ON(retries < 0); | 199 | BUG_ON(retries < 0); |
200 | 200 | ||
201 | err = MMC_ERR_INVALID; | 201 | err = MMC_ERR_INVALID; |
@@ -320,14 +320,14 @@ int __mmc_claim_host(struct mmc_host *host, struct mmc_card *card) | |||
320 | spin_lock_irqsave(&host->lock, flags); | 320 | spin_lock_irqsave(&host->lock, flags); |
321 | while (1) { | 321 | while (1) { |
322 | set_current_state(TASK_UNINTERRUPTIBLE); | 322 | set_current_state(TASK_UNINTERRUPTIBLE); |
323 | if (host->card_busy == NULL) | 323 | if (!host->claimed) |
324 | break; | 324 | break; |
325 | spin_unlock_irqrestore(&host->lock, flags); | 325 | spin_unlock_irqrestore(&host->lock, flags); |
326 | schedule(); | 326 | schedule(); |
327 | spin_lock_irqsave(&host->lock, flags); | 327 | spin_lock_irqsave(&host->lock, flags); |
328 | } | 328 | } |
329 | set_current_state(TASK_RUNNING); | 329 | set_current_state(TASK_RUNNING); |
330 | host->card_busy = card; | 330 | host->claimed = 1; |
331 | spin_unlock_irqrestore(&host->lock, flags); | 331 | spin_unlock_irqrestore(&host->lock, flags); |
332 | remove_wait_queue(&host->wq, &wait); | 332 | remove_wait_queue(&host->wq, &wait); |
333 | 333 | ||
@@ -353,10 +353,10 @@ void mmc_release_host(struct mmc_host *host) | |||
353 | { | 353 | { |
354 | unsigned long flags; | 354 | unsigned long flags; |
355 | 355 | ||
356 | BUG_ON(host->card_busy == NULL); | 356 | BUG_ON(!host->claimed); |
357 | 357 | ||
358 | spin_lock_irqsave(&host->lock, flags); | 358 | spin_lock_irqsave(&host->lock, flags); |
359 | host->card_busy = NULL; | 359 | host->claimed = 0; |
360 | spin_unlock_irqrestore(&host->lock, flags); | 360 | spin_unlock_irqrestore(&host->lock, flags); |
361 | 361 | ||
362 | wake_up(&host->wq); | 362 | wake_up(&host->wq); |
@@ -381,7 +381,7 @@ static int mmc_select_card(struct mmc_host *host, struct mmc_card *card) | |||
381 | int err; | 381 | int err; |
382 | struct mmc_command cmd; | 382 | struct mmc_command cmd; |
383 | 383 | ||
384 | BUG_ON(host->card_busy == NULL); | 384 | BUG_ON(!host->claimed); |
385 | 385 | ||
386 | if (host->card_selected == card) | 386 | if (host->card_selected == card) |
387 | return MMC_ERR_NONE; | 387 | return MMC_ERR_NONE; |