aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/ux500/mop500.c17
-rw-r--r--sound/soc/ux500/ux500_msp_i2s.c8
2 files changed, 20 insertions, 5 deletions
diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c
index 356611d9654d..54f7e25b6f7d 100644
--- a/sound/soc/ux500/mop500.c
+++ b/sound/soc/ux500/mop500.c
@@ -57,6 +57,20 @@ static struct snd_soc_card mop500_card = {
57 .num_links = ARRAY_SIZE(mop500_dai_links), 57 .num_links = ARRAY_SIZE(mop500_dai_links),
58}; 58};
59 59
60static void mop500_of_node_put(void)
61{
62 int i;
63
64 for (i = 0; i < 2; i++) {
65 if (mop500_dai_links[i].cpu_of_node)
66 of_node_put((struct device_node *)
67 mop500_dai_links[i].cpu_of_node);
68 if (mop500_dai_links[i].codec_of_node)
69 of_node_put((struct device_node *)
70 mop500_dai_links[i].codec_of_node);
71 }
72}
73
60static int __devinit mop500_of_probe(struct platform_device *pdev, 74static int __devinit mop500_of_probe(struct platform_device *pdev,
61 struct device_node *np) 75 struct device_node *np)
62{ 76{
@@ -69,6 +83,7 @@ static int __devinit mop500_of_probe(struct platform_device *pdev,
69 83
70 if (!(msp_np[0] && msp_np[1] && codec_np)) { 84 if (!(msp_np[0] && msp_np[1] && codec_np)) {
71 dev_err(&pdev->dev, "Phandle missing or invalid\n"); 85 dev_err(&pdev->dev, "Phandle missing or invalid\n");
86 mop500_of_node_put();
72 return -EINVAL; 87 return -EINVAL;
73 } 88 }
74 89
@@ -83,6 +98,7 @@ static int __devinit mop500_of_probe(struct platform_device *pdev,
83 98
84 return 0; 99 return 0;
85} 100}
101
86static int __devinit mop500_probe(struct platform_device *pdev) 102static int __devinit mop500_probe(struct platform_device *pdev)
87{ 103{
88 struct device_node *np = pdev->dev.of_node; 104 struct device_node *np = pdev->dev.of_node;
@@ -128,6 +144,7 @@ static int __devexit mop500_remove(struct platform_device *pdev)
128 144
129 snd_soc_unregister_card(mop500_card); 145 snd_soc_unregister_card(mop500_card);
130 mop500_ab8500_remove(mop500_card); 146 mop500_ab8500_remove(mop500_card);
147 mop500_of_node_put();
131 148
132 return 0; 149 return 0;
133} 150}
diff --git a/sound/soc/ux500/ux500_msp_i2s.c b/sound/soc/ux500/ux500_msp_i2s.c
index b7c996e77570..a26c6bf0a29b 100644
--- a/sound/soc/ux500/ux500_msp_i2s.c
+++ b/sound/soc/ux500/ux500_msp_i2s.c
@@ -18,6 +18,7 @@
18#include <linux/pinctrl/consumer.h> 18#include <linux/pinctrl/consumer.h>
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/io.h>
21#include <linux/of.h> 22#include <linux/of.h>
22 23
23#include <mach/hardware.h> 24#include <mach/hardware.h>
@@ -697,14 +698,11 @@ int ux500_msp_i2s_init_msp(struct platform_device *pdev,
697 platform_data = devm_kzalloc(&pdev->dev, 698 platform_data = devm_kzalloc(&pdev->dev,
698 sizeof(struct msp_i2s_platform_data), GFP_KERNEL); 699 sizeof(struct msp_i2s_platform_data), GFP_KERNEL);
699 if (!platform_data) 700 if (!platform_data)
700 ret = -ENOMEM; 701 return -ENOMEM;
701 } 702 }
702 } else 703 } else
703 if (!platform_data) 704 if (!platform_data)
704 ret = -EINVAL; 705 return -EINVAL;
705
706 if (ret)
707 goto err_res;
708 706
709 dev_dbg(&pdev->dev, "%s: Enter (name: %s, id: %d).\n", __func__, 707 dev_dbg(&pdev->dev, "%s: Enter (name: %s, id: %d).\n", __func__,
710 pdev->name, platform_data->id); 708 pdev->name, platform_data->id);