diff options
author | Timur Tabi <timur@freescale.com> | 2010-08-19 16:26:58 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-08-20 12:19:44 -0400 |
commit | 38fec7272bc033b75a0eb8976c56c2024d371b7d (patch) | |
tree | edde947e89e821a1f66440cf8d82d8e73475c1ab /sound/soc/fsl/fsl_ssi.c | |
parent | bf557a50f59fc62dfd89fa5bf08c6f5d96fb2f45 (diff) |
ASoC: mpc8610: replace of_device with platform_device
'struct of_device' no longer exists, and its functionality has been merged
into platform_device. Update the MPC8610 HPCD audio drivers (fsl_ssi, fsl_dma,
and mpc8610_hpcd) accordingly.
Also add a #include for slab.h, which is now needed for kmalloc and kfree.
Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/fsl/fsl_ssi.c')
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index d1c855ade8fb..4cc167a7aeb8 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -624,13 +624,13 @@ static void make_lowercase(char *s) | |||
624 | } | 624 | } |
625 | } | 625 | } |
626 | 626 | ||
627 | static int __devinit fsl_ssi_probe(struct of_device *of_dev, | 627 | static int __devinit fsl_ssi_probe(struct platform_device *pdev, |
628 | const struct of_device_id *match) | 628 | const struct of_device_id *match) |
629 | { | 629 | { |
630 | struct fsl_ssi_private *ssi_private; | 630 | struct fsl_ssi_private *ssi_private; |
631 | int ret = 0; | 631 | int ret = 0; |
632 | struct device_attribute *dev_attr = NULL; | 632 | struct device_attribute *dev_attr = NULL; |
633 | struct device_node *np = of_dev->dev.of_node; | 633 | struct device_node *np = pdev->dev.of_node; |
634 | const char *p, *sprop; | 634 | const char *p, *sprop; |
635 | const uint32_t *iprop; | 635 | const uint32_t *iprop; |
636 | struct resource res; | 636 | struct resource res; |
@@ -645,14 +645,14 @@ static int __devinit fsl_ssi_probe(struct of_device *of_dev, | |||
645 | 645 | ||
646 | /* Check for a codec-handle property. */ | 646 | /* Check for a codec-handle property. */ |
647 | if (!of_get_property(np, "codec-handle", NULL)) { | 647 | if (!of_get_property(np, "codec-handle", NULL)) { |
648 | dev_err(&of_dev->dev, "missing codec-handle property\n"); | 648 | dev_err(&pdev->dev, "missing codec-handle property\n"); |
649 | return -ENODEV; | 649 | return -ENODEV; |
650 | } | 650 | } |
651 | 651 | ||
652 | /* We only support the SSI in "I2S Slave" mode */ | 652 | /* We only support the SSI in "I2S Slave" mode */ |
653 | sprop = of_get_property(np, "fsl,mode", NULL); | 653 | sprop = of_get_property(np, "fsl,mode", NULL); |
654 | if (!sprop || strcmp(sprop, "i2s-slave")) { | 654 | if (!sprop || strcmp(sprop, "i2s-slave")) { |
655 | dev_notice(&of_dev->dev, "mode %s is unsupported\n", sprop); | 655 | dev_notice(&pdev->dev, "mode %s is unsupported\n", sprop); |
656 | return -ENODEV; | 656 | return -ENODEV; |
657 | } | 657 | } |
658 | 658 | ||
@@ -661,7 +661,7 @@ static int __devinit fsl_ssi_probe(struct of_device *of_dev, | |||
661 | ssi_private = kzalloc(sizeof(struct fsl_ssi_private) + strlen(p), | 661 | ssi_private = kzalloc(sizeof(struct fsl_ssi_private) + strlen(p), |
662 | GFP_KERNEL); | 662 | GFP_KERNEL); |
663 | if (!ssi_private) { | 663 | if (!ssi_private) { |
664 | dev_err(&of_dev->dev, "could not allocate DAI object\n"); | 664 | dev_err(&pdev->dev, "could not allocate DAI object\n"); |
665 | return -ENOMEM; | 665 | return -ENOMEM; |
666 | } | 666 | } |
667 | 667 | ||
@@ -675,7 +675,7 @@ static int __devinit fsl_ssi_probe(struct of_device *of_dev, | |||
675 | /* Get the addresses and IRQ */ | 675 | /* Get the addresses and IRQ */ |
676 | ret = of_address_to_resource(np, 0, &res); | 676 | ret = of_address_to_resource(np, 0, &res); |
677 | if (ret) { | 677 | if (ret) { |
678 | dev_err(&of_dev->dev, "could not determine device resources\n"); | 678 | dev_err(&pdev->dev, "could not determine device resources\n"); |
679 | kfree(ssi_private); | 679 | kfree(ssi_private); |
680 | return ret; | 680 | return ret; |
681 | } | 681 | } |
@@ -703,19 +703,19 @@ static int __devinit fsl_ssi_probe(struct of_device *of_dev, | |||
703 | dev_attr->attr.mode = S_IRUGO; | 703 | dev_attr->attr.mode = S_IRUGO; |
704 | dev_attr->show = fsl_sysfs_ssi_show; | 704 | dev_attr->show = fsl_sysfs_ssi_show; |
705 | 705 | ||
706 | ret = device_create_file(&of_dev->dev, dev_attr); | 706 | ret = device_create_file(&pdev->dev, dev_attr); |
707 | if (ret) { | 707 | if (ret) { |
708 | dev_err(&of_dev->dev, "could not create sysfs %s file\n", | 708 | dev_err(&pdev->dev, "could not create sysfs %s file\n", |
709 | ssi_private->dev_attr.attr.name); | 709 | ssi_private->dev_attr.attr.name); |
710 | goto error; | 710 | goto error; |
711 | } | 711 | } |
712 | 712 | ||
713 | /* Register with ASoC */ | 713 | /* Register with ASoC */ |
714 | dev_set_drvdata(&of_dev->dev, ssi_private); | 714 | dev_set_drvdata(&pdev->dev, ssi_private); |
715 | 715 | ||
716 | ret = snd_soc_register_dai(&of_dev->dev, &ssi_private->cpu_dai_drv); | 716 | ret = snd_soc_register_dai(&pdev->dev, &ssi_private->cpu_dai_drv); |
717 | if (ret) { | 717 | if (ret) { |
718 | dev_err(&of_dev->dev, "failed to register DAI: %d\n", ret); | 718 | dev_err(&pdev->dev, "failed to register DAI: %d\n", ret); |
719 | goto error; | 719 | goto error; |
720 | } | 720 | } |
721 | 721 | ||
@@ -733,20 +733,20 @@ static int __devinit fsl_ssi_probe(struct of_device *of_dev, | |||
733 | make_lowercase(name); | 733 | make_lowercase(name); |
734 | 734 | ||
735 | ssi_private->pdev = | 735 | ssi_private->pdev = |
736 | platform_device_register_data(&of_dev->dev, name, 0, NULL, 0); | 736 | platform_device_register_data(&pdev->dev, name, 0, NULL, 0); |
737 | if (IS_ERR(ssi_private->pdev)) { | 737 | if (IS_ERR(ssi_private->pdev)) { |
738 | ret = PTR_ERR(ssi_private->pdev); | 738 | ret = PTR_ERR(ssi_private->pdev); |
739 | dev_err(&of_dev->dev, "failed to register platform: %d\n", ret); | 739 | dev_err(&pdev->dev, "failed to register platform: %d\n", ret); |
740 | goto error; | 740 | goto error; |
741 | } | 741 | } |
742 | 742 | ||
743 | return 0; | 743 | return 0; |
744 | 744 | ||
745 | error: | 745 | error: |
746 | snd_soc_unregister_dai(&of_dev->dev); | 746 | snd_soc_unregister_dai(&pdev->dev); |
747 | dev_set_drvdata(&of_dev->dev, NULL); | 747 | dev_set_drvdata(&pdev->dev, NULL); |
748 | if (dev_attr) | 748 | if (dev_attr) |
749 | device_remove_file(&of_dev->dev, dev_attr); | 749 | device_remove_file(&pdev->dev, dev_attr); |
750 | irq_dispose_mapping(ssi_private->irq); | 750 | irq_dispose_mapping(ssi_private->irq); |
751 | iounmap(ssi_private->ssi); | 751 | iounmap(ssi_private->ssi); |
752 | kfree(ssi_private); | 752 | kfree(ssi_private); |
@@ -754,16 +754,16 @@ error: | |||
754 | return ret; | 754 | return ret; |
755 | } | 755 | } |
756 | 756 | ||
757 | static int fsl_ssi_remove(struct of_device *of_dev) | 757 | static int fsl_ssi_remove(struct platform_device *pdev) |
758 | { | 758 | { |
759 | struct fsl_ssi_private *ssi_private = dev_get_drvdata(&of_dev->dev); | 759 | struct fsl_ssi_private *ssi_private = dev_get_drvdata(&pdev->dev); |
760 | 760 | ||
761 | platform_device_unregister(ssi_private->pdev); | 761 | platform_device_unregister(ssi_private->pdev); |
762 | snd_soc_unregister_dai(&of_dev->dev); | 762 | snd_soc_unregister_dai(&pdev->dev); |
763 | device_remove_file(&of_dev->dev, &ssi_private->dev_attr); | 763 | device_remove_file(&pdev->dev, &ssi_private->dev_attr); |
764 | 764 | ||
765 | kfree(ssi_private); | 765 | kfree(ssi_private); |
766 | dev_set_drvdata(&of_dev->dev, NULL); | 766 | dev_set_drvdata(&pdev->dev, NULL); |
767 | 767 | ||
768 | return 0; | 768 | return 0; |
769 | } | 769 | } |