]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/mmc/host/sh_mmcif.c
Merge branch 'pm-qos'
[mirror_ubuntu-artful-kernel.git] / drivers / mmc / host / sh_mmcif.c
index a4ad93bf8b41b895d0517755ea5833163dc8a522..75a485448796e67d553cae26d3e3eda9fa329b98 100644 (file)
@@ -1328,7 +1328,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);
 
@@ -1339,14 +1339,13 @@ 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);
-
-       mmc_detect_change(host->mmc, 0);
+       ret = mmc_add_host(mmc);
+       if (ret < 0)
+               goto clean_up5;
 
        dev_pm_qos_expose_latency_limit(&pdev->dev, 100);
 
@@ -1355,8 +1354,11 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
                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);