diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-25 06:17:24 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-25 06:17:24 -0500 |
commit | 2c54c1586c78775cfdfb071e68b27e14b668921f (patch) | |
tree | cf57390a0b82d2bd1ade5e5356434c66c39af38a /sound/soc/imx | |
parent | b26bb71f610f9b346203bff407e4278d98f9fe80 (diff) | |
parent | 8b6b30ab665d3bbb23180c39f6215e6f64516ed0 (diff) |
Merge branch 'for-2.6.37' into for-2.6.38
Diffstat (limited to 'sound/soc/imx')
-rw-r--r-- | sound/soc/imx/imx-ssi.c | 15 | ||||
-rw-r--r-- | sound/soc/imx/phycore-ac97.c | 28 |
2 files changed, 32 insertions, 11 deletions
diff --git a/sound/soc/imx/imx-ssi.c b/sound/soc/imx/imx-ssi.c index ad21f814e6a1..30894ea7f333 100644 --- a/sound/soc/imx/imx-ssi.c +++ b/sound/soc/imx/imx-ssi.c | |||
@@ -679,8 +679,11 @@ static int imx_ssi_probe(struct platform_device *pdev) | |||
679 | } | 679 | } |
680 | 680 | ||
681 | ssi->soc_platform_pdev_fiq = platform_device_alloc("imx-fiq-pcm-audio", pdev->id); | 681 | ssi->soc_platform_pdev_fiq = platform_device_alloc("imx-fiq-pcm-audio", pdev->id); |
682 | if (!ssi->soc_platform_pdev_fiq) | 682 | if (!ssi->soc_platform_pdev_fiq) { |
683 | ret = -ENOMEM; | ||
683 | goto failed_pdev_fiq_alloc; | 684 | goto failed_pdev_fiq_alloc; |
685 | } | ||
686 | |||
684 | platform_set_drvdata(ssi->soc_platform_pdev_fiq, ssi); | 687 | platform_set_drvdata(ssi->soc_platform_pdev_fiq, ssi); |
685 | ret = platform_device_add(ssi->soc_platform_pdev_fiq); | 688 | ret = platform_device_add(ssi->soc_platform_pdev_fiq); |
686 | if (ret) { | 689 | if (ret) { |
@@ -689,8 +692,11 @@ static int imx_ssi_probe(struct platform_device *pdev) | |||
689 | } | 692 | } |
690 | 693 | ||
691 | ssi->soc_platform_pdev = platform_device_alloc("imx-pcm-audio", pdev->id); | 694 | ssi->soc_platform_pdev = platform_device_alloc("imx-pcm-audio", pdev->id); |
692 | if (!ssi->soc_platform_pdev) | 695 | if (!ssi->soc_platform_pdev) { |
696 | ret = -ENOMEM; | ||
693 | goto failed_pdev_alloc; | 697 | goto failed_pdev_alloc; |
698 | } | ||
699 | |||
694 | platform_set_drvdata(ssi->soc_platform_pdev, ssi); | 700 | platform_set_drvdata(ssi->soc_platform_pdev, ssi); |
695 | ret = platform_device_add(ssi->soc_platform_pdev); | 701 | ret = platform_device_add(ssi->soc_platform_pdev); |
696 | if (ret) { | 702 | if (ret) { |
@@ -703,6 +709,7 @@ static int imx_ssi_probe(struct platform_device *pdev) | |||
703 | failed_pdev_add: | 709 | failed_pdev_add: |
704 | platform_device_put(ssi->soc_platform_pdev); | 710 | platform_device_put(ssi->soc_platform_pdev); |
705 | failed_pdev_alloc: | 711 | failed_pdev_alloc: |
712 | platform_device_del(ssi->soc_platform_pdev_fiq); | ||
706 | failed_pdev_fiq_add: | 713 | failed_pdev_fiq_add: |
707 | platform_device_put(ssi->soc_platform_pdev_fiq); | 714 | platform_device_put(ssi->soc_platform_pdev_fiq); |
708 | failed_pdev_fiq_alloc: | 715 | failed_pdev_fiq_alloc: |
@@ -726,8 +733,8 @@ static int __devexit imx_ssi_remove(struct platform_device *pdev) | |||
726 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 733 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
727 | struct imx_ssi *ssi = platform_get_drvdata(pdev); | 734 | struct imx_ssi *ssi = platform_get_drvdata(pdev); |
728 | 735 | ||
729 | platform_device_del(ssi->soc_platform_pdev); | 736 | platform_device_unregister(ssi->soc_platform_pdev); |
730 | platform_device_put(ssi->soc_platform_pdev); | 737 | platform_device_unregister(ssi->soc_platform_pdev_fiq); |
731 | 738 | ||
732 | snd_soc_unregister_dai(&pdev->dev); | 739 | snd_soc_unregister_dai(&pdev->dev); |
733 | 740 | ||
diff --git a/sound/soc/imx/phycore-ac97.c b/sound/soc/imx/phycore-ac97.c index db157f773c15..a7deb5cb2433 100644 --- a/sound/soc/imx/phycore-ac97.c +++ b/sound/soc/imx/phycore-ac97.c | |||
@@ -42,6 +42,7 @@ static struct snd_soc_card imx_phycore = { | |||
42 | .num_links = ARRAY_SIZE(imx_phycore_dai_ac97), | 42 | .num_links = ARRAY_SIZE(imx_phycore_dai_ac97), |
43 | }; | 43 | }; |
44 | 44 | ||
45 | static struct platform_device *imx_phycore_snd_ac97_device; | ||
45 | static struct platform_device *imx_phycore_snd_device; | 46 | static struct platform_device *imx_phycore_snd_device; |
46 | 47 | ||
47 | static int __init imx_phycore_init(void) | 48 | static int __init imx_phycore_init(void) |
@@ -52,29 +53,42 @@ static int __init imx_phycore_init(void) | |||
52 | /* return happy. We might run on a totally different machine */ | 53 | /* return happy. We might run on a totally different machine */ |
53 | return 0; | 54 | return 0; |
54 | 55 | ||
55 | imx_phycore_snd_device = platform_device_alloc("soc-audio", -1); | 56 | imx_phycore_snd_ac97_device = platform_device_alloc("soc-audio", -1); |
56 | if (!imx_phycore_snd_device) | 57 | if (!imx_phycore_snd_ac97_device) |
57 | return -ENOMEM; | 58 | return -ENOMEM; |
58 | 59 | ||
59 | platform_set_drvdata(imx_phycore_snd_device, &imx_phycore); | 60 | platform_set_drvdata(imx_phycore_snd_ac97_device, &imx_phycore); |
60 | ret = platform_device_add(imx_phycore_snd_device); | 61 | ret = platform_device_add(imx_phycore_snd_ac97_device); |
62 | if (ret) | ||
63 | goto fail1; | ||
61 | 64 | ||
62 | imx_phycore_snd_device = platform_device_alloc("wm9712-codec", -1); | 65 | imx_phycore_snd_device = platform_device_alloc("wm9712-codec", -1); |
63 | if (!imx_phycore_snd_device) | 66 | if (!imx_phycore_snd_device) { |
64 | return -ENOMEM; | 67 | ret = -ENOMEM; |
68 | goto fail2; | ||
69 | } | ||
65 | ret = platform_device_add(imx_phycore_snd_device); | 70 | ret = platform_device_add(imx_phycore_snd_device); |
66 | 71 | ||
67 | if (ret) { | 72 | if (ret) { |
68 | printk(KERN_ERR "ASoC: Platform device allocation failed\n"); | 73 | printk(KERN_ERR "ASoC: Platform device allocation failed\n"); |
69 | platform_device_put(imx_phycore_snd_device); | 74 | goto fail3; |
70 | } | 75 | } |
71 | 76 | ||
77 | return 0; | ||
78 | |||
79 | fail3: | ||
80 | platform_device_put(imx_phycore_snd_device); | ||
81 | fail2: | ||
82 | platform_device_del(imx_phycore_snd_ac97_device); | ||
83 | fail1: | ||
84 | platform_device_put(imx_phycore_snd_ac97_device); | ||
72 | return ret; | 85 | return ret; |
73 | } | 86 | } |
74 | 87 | ||
75 | static void __exit imx_phycore_exit(void) | 88 | static void __exit imx_phycore_exit(void) |
76 | { | 89 | { |
77 | platform_device_unregister(imx_phycore_snd_device); | 90 | platform_device_unregister(imx_phycore_snd_device); |
91 | platform_device_unregister(imx_phycore_snd_ac97_device); | ||
78 | } | 92 | } |
79 | 93 | ||
80 | late_initcall(imx_phycore_init); | 94 | late_initcall(imx_phycore_init); |