diff options
Diffstat (limited to 'drivers/mmc/host/s3cmci.c')
-rw-r--r-- | drivers/mmc/host/s3cmci.c | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c index 6a1e4994b724..be550c26da68 100644 --- a/drivers/mmc/host/s3cmci.c +++ b/drivers/mmc/host/s3cmci.c | |||
@@ -1331,21 +1331,30 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440) | |||
1331 | return ret; | 1331 | return ret; |
1332 | } | 1332 | } |
1333 | 1333 | ||
1334 | static void s3cmci_shutdown(struct platform_device *pdev) | ||
1335 | { | ||
1336 | struct mmc_host *mmc = platform_get_drvdata(pdev); | ||
1337 | struct s3cmci_host *host = mmc_priv(mmc); | ||
1338 | |||
1339 | if (host->irq_cd >= 0) | ||
1340 | free_irq(host->irq_cd, host); | ||
1341 | |||
1342 | mmc_remove_host(mmc); | ||
1343 | clk_disable(host->clk); | ||
1344 | } | ||
1345 | |||
1334 | static int __devexit s3cmci_remove(struct platform_device *pdev) | 1346 | static int __devexit s3cmci_remove(struct platform_device *pdev) |
1335 | { | 1347 | { |
1336 | struct mmc_host *mmc = platform_get_drvdata(pdev); | 1348 | struct mmc_host *mmc = platform_get_drvdata(pdev); |
1337 | struct s3cmci_host *host = mmc_priv(mmc); | 1349 | struct s3cmci_host *host = mmc_priv(mmc); |
1338 | 1350 | ||
1339 | mmc_remove_host(mmc); | 1351 | s3cmci_shutdown(pdev); |
1340 | 1352 | ||
1341 | clk_disable(host->clk); | ||
1342 | clk_put(host->clk); | 1353 | clk_put(host->clk); |
1343 | 1354 | ||
1344 | tasklet_disable(&host->pio_tasklet); | 1355 | tasklet_disable(&host->pio_tasklet); |
1345 | s3c2410_dma_free(S3CMCI_DMA, &s3cmci_dma_client); | 1356 | s3c2410_dma_free(S3CMCI_DMA, &s3cmci_dma_client); |
1346 | 1357 | ||
1347 | if (host->irq_cd >= 0) | ||
1348 | free_irq(host->irq_cd, host); | ||
1349 | free_irq(host->irq, host); | 1358 | free_irq(host->irq, host); |
1350 | 1359 | ||
1351 | iounmap(host->base); | 1360 | iounmap(host->base); |
@@ -1355,17 +1364,17 @@ static int __devexit s3cmci_remove(struct platform_device *pdev) | |||
1355 | return 0; | 1364 | return 0; |
1356 | } | 1365 | } |
1357 | 1366 | ||
1358 | static int __devinit s3cmci_probe_2410(struct platform_device *dev) | 1367 | static int __devinit s3cmci_2410_probe(struct platform_device *dev) |
1359 | { | 1368 | { |
1360 | return s3cmci_probe(dev, 0); | 1369 | return s3cmci_probe(dev, 0); |
1361 | } | 1370 | } |
1362 | 1371 | ||
1363 | static int __devinit s3cmci_probe_2412(struct platform_device *dev) | 1372 | static int __devinit s3cmci_2412_probe(struct platform_device *dev) |
1364 | { | 1373 | { |
1365 | return s3cmci_probe(dev, 1); | 1374 | return s3cmci_probe(dev, 1); |
1366 | } | 1375 | } |
1367 | 1376 | ||
1368 | static int __devinit s3cmci_probe_2440(struct platform_device *dev) | 1377 | static int __devinit s3cmci_2440_probe(struct platform_device *dev) |
1369 | { | 1378 | { |
1370 | return s3cmci_probe(dev, 1); | 1379 | return s3cmci_probe(dev, 1); |
1371 | } | 1380 | } |
@@ -1392,29 +1401,32 @@ static int s3cmci_resume(struct platform_device *dev) | |||
1392 | #endif /* CONFIG_PM */ | 1401 | #endif /* CONFIG_PM */ |
1393 | 1402 | ||
1394 | 1403 | ||
1395 | static struct platform_driver s3cmci_driver_2410 = { | 1404 | static struct platform_driver s3cmci_2410_driver = { |
1396 | .driver.name = "s3c2410-sdi", | 1405 | .driver.name = "s3c2410-sdi", |
1397 | .driver.owner = THIS_MODULE, | 1406 | .driver.owner = THIS_MODULE, |
1398 | .probe = s3cmci_probe_2410, | 1407 | .probe = s3cmci_2410_probe, |
1399 | .remove = __devexit_p(s3cmci_remove), | 1408 | .remove = __devexit_p(s3cmci_remove), |
1409 | .shutdown = s3cmci_shutdown, | ||
1400 | .suspend = s3cmci_suspend, | 1410 | .suspend = s3cmci_suspend, |
1401 | .resume = s3cmci_resume, | 1411 | .resume = s3cmci_resume, |
1402 | }; | 1412 | }; |
1403 | 1413 | ||
1404 | static struct platform_driver s3cmci_driver_2412 = { | 1414 | static struct platform_driver s3cmci_2412_driver = { |
1405 | .driver.name = "s3c2412-sdi", | 1415 | .driver.name = "s3c2412-sdi", |
1406 | .driver.owner = THIS_MODULE, | 1416 | .driver.owner = THIS_MODULE, |
1407 | .probe = s3cmci_probe_2412, | 1417 | .probe = s3cmci_2412_probe, |
1408 | .remove = __devexit_p(s3cmci_remove), | 1418 | .remove = __devexit_p(s3cmci_remove), |
1419 | .shutdown = s3cmci_shutdown, | ||
1409 | .suspend = s3cmci_suspend, | 1420 | .suspend = s3cmci_suspend, |
1410 | .resume = s3cmci_resume, | 1421 | .resume = s3cmci_resume, |
1411 | }; | 1422 | }; |
1412 | 1423 | ||
1413 | static struct platform_driver s3cmci_driver_2440 = { | 1424 | static struct platform_driver s3cmci_2440_driver = { |
1414 | .driver.name = "s3c2440-sdi", | 1425 | .driver.name = "s3c2440-sdi", |
1415 | .driver.owner = THIS_MODULE, | 1426 | .driver.owner = THIS_MODULE, |
1416 | .probe = s3cmci_probe_2440, | 1427 | .probe = s3cmci_2440_probe, |
1417 | .remove = __devexit_p(s3cmci_remove), | 1428 | .remove = __devexit_p(s3cmci_remove), |
1429 | .shutdown = s3cmci_shutdown, | ||
1418 | .suspend = s3cmci_suspend, | 1430 | .suspend = s3cmci_suspend, |
1419 | .resume = s3cmci_resume, | 1431 | .resume = s3cmci_resume, |
1420 | }; | 1432 | }; |
@@ -1422,17 +1434,17 @@ static struct platform_driver s3cmci_driver_2440 = { | |||
1422 | 1434 | ||
1423 | static int __init s3cmci_init(void) | 1435 | static int __init s3cmci_init(void) |
1424 | { | 1436 | { |
1425 | platform_driver_register(&s3cmci_driver_2410); | 1437 | platform_driver_register(&s3cmci_2410_driver); |
1426 | platform_driver_register(&s3cmci_driver_2412); | 1438 | platform_driver_register(&s3cmci_2412_driver); |
1427 | platform_driver_register(&s3cmci_driver_2440); | 1439 | platform_driver_register(&s3cmci_2440_driver); |
1428 | return 0; | 1440 | return 0; |
1429 | } | 1441 | } |
1430 | 1442 | ||
1431 | static void __exit s3cmci_exit(void) | 1443 | static void __exit s3cmci_exit(void) |
1432 | { | 1444 | { |
1433 | platform_driver_unregister(&s3cmci_driver_2410); | 1445 | platform_driver_unregister(&s3cmci_2410_driver); |
1434 | platform_driver_unregister(&s3cmci_driver_2412); | 1446 | platform_driver_unregister(&s3cmci_2412_driver); |
1435 | platform_driver_unregister(&s3cmci_driver_2440); | 1447 | platform_driver_unregister(&s3cmci_2440_driver); |
1436 | } | 1448 | } |
1437 | 1449 | ||
1438 | module_init(s3cmci_init); | 1450 | module_init(s3cmci_init); |