Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f22ee4edf63e7480511112d9965c71e07be3f8b7
Commit:     f22ee4edf63e7480511112d9965c71e07be3f8b7
Parent:     279bc4450989215e741c2c9d3a726f1ac96ede40
Author:     Pierre Ossman <[EMAIL PROTECTED]>
AuthorDate: Tue Dec 26 15:11:23 2006 +0100
Committer:  Pierre Ossman <[EMAIL PROTECTED]>
CommitDate: Sun Feb 4 20:54:06 2007 +0100

    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 <[EMAIL PROTECTED]>
---
 drivers/mmc/mmc.c        |   16 ++++++++--------
 include/linux/mmc/host.h |    5 +++--
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 6f2a282..105f419 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)
                 mmc_hostname(host), mrq->cmd->opcode,
                 mrq->cmd->arg, mrq->cmd->flags);
 
-       WARN_ON(host->card_busy == NULL);
+       WARN_ON(!host->claimed);
 
        mrq->cmd->error = 0;
        mrq->cmd->mrq = mrq;
@@ -157,7 +157,7 @@ int mmc_wait_for_cmd(struct mmc_host *host, struct 
mmc_command *cmd, int retries
 {
        struct mmc_request mrq;
 
-       BUG_ON(host->card_busy == NULL);
+       BUG_ON(!host->claimed);
 
        memset(&mrq, 0, sizeof(struct mmc_request));
 
@@ -195,7 +195,7 @@ int mmc_wait_for_app_cmd(struct mmc_host *host, unsigned 
int rca,
 
        int i, err;
 
-       BUG_ON(host->card_busy == NULL);
+       BUG_ON(!host->claimed);
        BUG_ON(retries < 0);
 
        err = MMC_ERR_INVALID;
@@ -320,14 +320,14 @@ int __mmc_claim_host(struct mmc_host *host, struct 
mmc_card *card)
        spin_lock_irqsave(&host->lock, flags);
        while (1) {
                set_current_state(TASK_UNINTERRUPTIBLE);
-               if (host->card_busy == NULL)
+               if (!host->claimed)
                        break;
                spin_unlock_irqrestore(&host->lock, flags);
                schedule();
                spin_lock_irqsave(&host->lock, flags);
        }
        set_current_state(TASK_RUNNING);
-       host->card_busy = card;
+       host->claimed = 1;
        spin_unlock_irqrestore(&host->lock, flags);
        remove_wait_queue(&host->wq, &wait);
 
@@ -353,10 +353,10 @@ void mmc_release_host(struct mmc_host *host)
 {
        unsigned long flags;
 
-       BUG_ON(host->card_busy == NULL);
+       BUG_ON(!host->claimed);
 
        spin_lock_irqsave(&host->lock, flags);
-       host->card_busy = NULL;
+       host->claimed = 0;
        spin_unlock_irqrestore(&host->lock, flags);
 
        wake_up(&host->wq);
@@ -381,7 +381,7 @@ static int mmc_select_card(struct mmc_host *host, struct 
mmc_card *card)
        int err;
        struct mmc_command cmd;
 
-       BUG_ON(host->card_busy == NULL);
+       BUG_ON(!host->claimed);
 
        if (host->card_selected == card)
                return MMC_ERR_NONE;
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index c15ae19..dc4c6e3 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -106,8 +106,9 @@ struct mmc_host {
        struct list_head        cards;          /* devices attached to this 
host */
 
        wait_queue_head_t       wq;
-       spinlock_t              lock;           /* card_busy lock */
-       struct mmc_card         *card_busy;     /* the MMC card claiming host */
+       spinlock_t              lock;           /* claimed lock */
+       unsigned int            claimed:1;      /* host exclusively claimed */
+
        struct mmc_card         *card_selected; /* the selected MMC card */
 
        struct delayed_work     detect;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to