aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/host/sh_mmcif.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index f5d8b53be333..352d4797865b 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1327,7 +1327,7 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
1327 if (ret < 0) 1327 if (ret < 0)
1328 goto clean_up2; 1328 goto clean_up2;
1329 1329
1330 mmc_add_host(mmc); 1330 INIT_DELAYED_WORK(&host->timeout_work, mmcif_timeout_work);
1331 1331
1332 sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL); 1332 sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);
1333 1333
@@ -1338,22 +1338,24 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
1338 } 1338 }
1339 ret = request_threaded_irq(irq[1], sh_mmcif_intr, sh_mmcif_irqt, 0, "sh_mmc:int", host); 1339 ret = request_threaded_irq(irq[1], sh_mmcif_intr, sh_mmcif_irqt, 0, "sh_mmc:int", host);
1340 if (ret) { 1340 if (ret) {
1341 free_irq(irq[0], host);
1342 dev_err(&pdev->dev, "request_irq error (sh_mmc:int)\n"); 1341 dev_err(&pdev->dev, "request_irq error (sh_mmc:int)\n");
1343 goto clean_up3; 1342 goto clean_up4;
1344 } 1343 }
1345 1344
1346 INIT_DELAYED_WORK(&host->timeout_work, mmcif_timeout_work); 1345 ret = mmc_add_host(mmc);
1347 1346 if (ret < 0)
1348 mmc_detect_change(host->mmc, 0); 1347 goto clean_up5;
1349 1348
1350 dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION); 1349 dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION);
1351 dev_dbg(&pdev->dev, "chip ver H'%04x\n", 1350 dev_dbg(&pdev->dev, "chip ver H'%04x\n",
1352 sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0x0000ffff); 1351 sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0x0000ffff);
1353 return ret; 1352 return ret;
1354 1353
1354clean_up5:
1355 free_irq(irq[1], host);
1356clean_up4:
1357 free_irq(irq[0], host);
1355clean_up3: 1358clean_up3:
1356 mmc_remove_host(mmc);
1357 pm_runtime_suspend(&pdev->dev); 1359 pm_runtime_suspend(&pdev->dev);
1358clean_up2: 1360clean_up2:
1359 pm_runtime_disable(&pdev->dev); 1361 pm_runtime_disable(&pdev->dev);