aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/pxamci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/pxamci.c')
-rw-r--r--drivers/mmc/pxamci.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c
index f31e247b2cbe..ee8f8a0420d1 100644
--- a/drivers/mmc/pxamci.c
+++ b/drivers/mmc/pxamci.c
@@ -428,9 +428,8 @@ static irqreturn_t pxamci_detect_irq(int irq, void *devid, struct pt_regs *regs)
428 return IRQ_HANDLED; 428 return IRQ_HANDLED;
429} 429}
430 430
431static int pxamci_probe(struct device *dev) 431static int pxamci_probe(struct platform_device *pdev)
432{ 432{
433 struct platform_device *pdev = to_platform_device(dev);
434 struct mmc_host *mmc; 433 struct mmc_host *mmc;
435 struct pxamci_host *host = NULL; 434 struct pxamci_host *host = NULL;
436 struct resource *r; 435 struct resource *r;
@@ -445,7 +444,7 @@ static int pxamci_probe(struct device *dev)
445 if (!r) 444 if (!r)
446 return -EBUSY; 445 return -EBUSY;
447 446
448 mmc = mmc_alloc_host(sizeof(struct pxamci_host), dev); 447 mmc = mmc_alloc_host(sizeof(struct pxamci_host), &pdev->dev);
449 if (!mmc) { 448 if (!mmc) {
450 ret = -ENOMEM; 449 ret = -ENOMEM;
451 goto out; 450 goto out;
@@ -474,7 +473,7 @@ static int pxamci_probe(struct device *dev)
474 host->pdata->ocr_mask : 473 host->pdata->ocr_mask :
475 MMC_VDD_32_33|MMC_VDD_33_34; 474 MMC_VDD_32_33|MMC_VDD_33_34;
476 475
477 host->sg_cpu = dma_alloc_coherent(dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL); 476 host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL);
478 if (!host->sg_cpu) { 477 if (!host->sg_cpu) {
479 ret = -ENOMEM; 478 ret = -ENOMEM;
480 goto out; 479 goto out;
@@ -511,10 +510,10 @@ static int pxamci_probe(struct device *dev)
511 if (ret) 510 if (ret)
512 goto out; 511 goto out;
513 512
514 dev_set_drvdata(dev, mmc); 513 platform_set_drvdata(pdev, mmc);
515 514
516 if (host->pdata && host->pdata->init) 515 if (host->pdata && host->pdata->init)
517 host->pdata->init(dev, pxamci_detect_irq, mmc); 516 host->pdata->init(&pdev->dev, pxamci_detect_irq, mmc);
518 517
519 mmc_add_host(mmc); 518 mmc_add_host(mmc);
520 519
@@ -527,7 +526,7 @@ static int pxamci_probe(struct device *dev)
527 if (host->base) 526 if (host->base)
528 iounmap(host->base); 527 iounmap(host->base);
529 if (host->sg_cpu) 528 if (host->sg_cpu)
530 dma_free_coherent(dev, PAGE_SIZE, host->sg_cpu, host->sg_dma); 529 dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
531 } 530 }
532 if (mmc) 531 if (mmc)
533 mmc_free_host(mmc); 532 mmc_free_host(mmc);
@@ -535,17 +534,17 @@ static int pxamci_probe(struct device *dev)
535 return ret; 534 return ret;
536} 535}
537 536
538static int pxamci_remove(struct device *dev) 537static int pxamci_remove(struct platform_device *pdev)
539{ 538{
540 struct mmc_host *mmc = dev_get_drvdata(dev); 539 struct mmc_host *mmc = platform_get_drvdata(pdev);
541 540
542 dev_set_drvdata(dev, NULL); 541 platform_set_drvdata(pdev, NULL);
543 542
544 if (mmc) { 543 if (mmc) {
545 struct pxamci_host *host = mmc_priv(mmc); 544 struct pxamci_host *host = mmc_priv(mmc);
546 545
547 if (host->pdata && host->pdata->exit) 546 if (host->pdata && host->pdata->exit)
548 host->pdata->exit(dev, mmc); 547 host->pdata->exit(&pdev->dev, mmc);
549 548
550 mmc_remove_host(mmc); 549 mmc_remove_host(mmc);
551 550
@@ -560,7 +559,7 @@ static int pxamci_remove(struct device *dev)
560 free_irq(host->irq, host); 559 free_irq(host->irq, host);
561 pxa_free_dma(host->dma); 560 pxa_free_dma(host->dma);
562 iounmap(host->base); 561 iounmap(host->base);
563 dma_free_coherent(dev, PAGE_SIZE, host->sg_cpu, host->sg_dma); 562 dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
564 563
565 release_resource(host->res); 564 release_resource(host->res);
566 565
@@ -570,9 +569,9 @@ static int pxamci_remove(struct device *dev)
570} 569}
571 570
572#ifdef CONFIG_PM 571#ifdef CONFIG_PM
573static int pxamci_suspend(struct device *dev, pm_message_t state) 572static int pxamci_suspend(struct platform_device *dev, pm_message_t state)
574{ 573{
575 struct mmc_host *mmc = dev_get_drvdata(dev); 574 struct mmc_host *mmc = platform_get_drvdata(dev);
576 int ret = 0; 575 int ret = 0;
577 576
578 if (mmc) 577 if (mmc)
@@ -581,9 +580,9 @@ static int pxamci_suspend(struct device *dev, pm_message_t state)
581 return ret; 580 return ret;
582} 581}
583 582
584static int pxamci_resume(struct device *dev) 583static int pxamci_resume(struct platform_device *dev)
585{ 584{
586 struct mmc_host *mmc = dev_get_drvdata(dev); 585 struct mmc_host *mmc = platform_get_drvdata(dev);
587 int ret = 0; 586 int ret = 0;
588 587
589 if (mmc) 588 if (mmc)
@@ -596,23 +595,24 @@ static int pxamci_resume(struct device *dev)
596#define pxamci_resume NULL 595#define pxamci_resume NULL
597#endif 596#endif
598 597
599static struct device_driver pxamci_driver = { 598static struct platform_driver pxamci_driver = {
600 .name = DRIVER_NAME,
601 .bus = &platform_bus_type,
602 .probe = pxamci_probe, 599 .probe = pxamci_probe,
603 .remove = pxamci_remove, 600 .remove = pxamci_remove,
604 .suspend = pxamci_suspend, 601 .suspend = pxamci_suspend,
605 .resume = pxamci_resume, 602 .resume = pxamci_resume,
603 .driver = {
604 .name = DRIVER_NAME,
605 },
606}; 606};
607 607
608static int __init pxamci_init(void) 608static int __init pxamci_init(void)
609{ 609{
610 return driver_register(&pxamci_driver); 610 return platform_driver_register(&pxamci_driver);
611} 611}
612 612
613static void __exit pxamci_exit(void) 613static void __exit pxamci_exit(void)
614{ 614{
615 driver_unregister(&pxamci_driver); 615 platform_driver_unregister(&pxamci_driver);
616} 616}
617 617
618module_init(pxamci_init); 618module_init(pxamci_init);