]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mmc/host/wbsd.c
MMC: S3C24XX: Add support to invert write protect line
[linux-2.6-omap-h63xx.git] / drivers / mmc / host / wbsd.c
index be624a049c67d7b0fad8c27537c28f7178c1eaa6..67e5a9b80f53831358698d83c9243220cdebc2a1 100644 (file)
@@ -939,7 +939,7 @@ static int wbsd_get_ro(struct mmc_host *mmc)
 
        spin_unlock_bh(&host->lock);
 
-       return csr & WBSD_WRPT;
+       return !!(csr & WBSD_WRPT);
 }
 
 static const struct mmc_host_ops wbsd_ops = {
@@ -1457,17 +1457,7 @@ static int __devinit wbsd_request_irq(struct wbsd_host *host, int irq)
        int ret;
 
        /*
-        * Allocate interrupt.
-        */
-
-       ret = request_irq(irq, wbsd_irq, IRQF_SHARED, DRIVER_NAME, host);
-       if (ret)
-               return ret;
-
-       host->irq = irq;
-
-       /*
-        * Set up tasklets.
+        * Set up tasklets. Must be done before requesting interrupt.
         */
        tasklet_init(&host->card_tasklet, wbsd_tasklet_card,
                        (unsigned long)host);
@@ -1480,6 +1470,15 @@ static int __devinit wbsd_request_irq(struct wbsd_host *host, int irq)
        tasklet_init(&host->finish_tasklet, wbsd_tasklet_finish,
                        (unsigned long)host);
 
+       /*
+        * Allocate interrupt.
+        */
+       ret = request_irq(irq, wbsd_irq, IRQF_SHARED, DRIVER_NAME, host);
+       if (ret)
+               return ret;
+
+       host->irq = irq;
+
        return 0;
 }