Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma
[linux-flexiantxendom0-3.2.10.git] / drivers / mmc / host / sh_mmcif.c
index 3d00f1a..aafaf0b 100644 (file)
@@ -56,6 +56,7 @@
 #include <linux/mmc/sh_mmcif.h>
 #include <linux/pagemap.h>
 #include <linux/platform_device.h>
+#include <linux/pm_qos.h>
 #include <linux/pm_runtime.h>
 #include <linux/spinlock.h>
 #include <linux/module.h>
@@ -745,7 +746,6 @@ static u32 sh_mmcif_set_cmd(struct sh_mmcif_host *host,
        case MMC_SET_WRITE_PROT:
        case MMC_CLR_WRITE_PROT:
        case MMC_ERASE:
-       case MMC_GEN_CMD:
                tmp |= CMD_SET_RBSY;
                break;
        }
@@ -828,7 +828,6 @@ static void sh_mmcif_start_cmd(struct sh_mmcif_host *host,
        case MMC_SET_WRITE_PROT:
        case MMC_CLR_WRITE_PROT:
        case MMC_ERASE:
-       case MMC_GEN_CMD:
                mask = MASK_START_CMD | MASK_MRBSYE;
                break;
        default:
@@ -1327,7 +1326,7 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
        if (ret < 0)
                goto clean_up2;
 
-       mmc_add_host(mmc);
+       INIT_DELAYED_WORK(&host->timeout_work, mmcif_timeout_work);
 
        sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);
 
@@ -1338,22 +1337,26 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
        }
        ret = request_threaded_irq(irq[1], sh_mmcif_intr, sh_mmcif_irqt, 0, "sh_mmc:int", host);
        if (ret) {
-               free_irq(irq[0], host);
                dev_err(&pdev->dev, "request_irq error (sh_mmc:int)\n");
-               goto clean_up3;
+               goto clean_up4;
        }
 
-       INIT_DELAYED_WORK(&host->timeout_work, mmcif_timeout_work);
+       ret = mmc_add_host(mmc);
+       if (ret < 0)
+               goto clean_up5;
 
-       mmc_detect_change(host->mmc, 0);
+       dev_pm_qos_expose_latency_limit(&pdev->dev, 100);
 
        dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION);
        dev_dbg(&pdev->dev, "chip ver H'%04x\n",
                sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0x0000ffff);
        return ret;
 
+clean_up5:
+       free_irq(irq[1], host);
+clean_up4:
+       free_irq(irq[0], host);
 clean_up3:
-       mmc_remove_host(mmc);
        pm_runtime_suspend(&pdev->dev);
 clean_up2:
        pm_runtime_disable(&pdev->dev);
@@ -1374,6 +1377,8 @@ static int __devexit sh_mmcif_remove(struct platform_device *pdev)
        host->dying = true;
        pm_runtime_get_sync(&pdev->dev);
 
+       dev_pm_qos_hide_latency_limit(&pdev->dev);
+
        mmc_remove_host(host->mmc);
        sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);