aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/ux500/mop500.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/ux500/mop500.c')
-rw-r--r--sound/soc/ux500/mop500.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c
index 759c635412a2..5315adc1134b 100644
--- a/sound/soc/ux500/mop500.c
+++ b/sound/soc/ux500/mop500.c
@@ -59,10 +59,11 @@ static void mop500_of_node_put(void)
{
int i;
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < 2; i++)
of_node_put(mop500_dai_links[i].cpu_of_node);
- of_node_put(mop500_dai_links[i].codec_of_node);
- }
+
+ /* Both links use the same codec, which is refcounted only once */
+ of_node_put(mop500_dai_links[0].codec_of_node);
}
static int mop500_of_probe(struct platform_device *pdev,
@@ -77,7 +78,9 @@ static int mop500_of_probe(struct platform_device *pdev,
if (!(msp_np[0] && msp_np[1] && codec_np)) {
dev_err(&pdev->dev, "Phandle missing or invalid\n");
- mop500_of_node_put();
+ for (i = 0; i < 2; i++)
+ of_node_put(msp_np[i]);
+ of_node_put(codec_np);
return -EINVAL;
}