diff options
| -rw-r--r-- | sound/soc/ux500/mop500.c | 17 |
1 files changed, 17 insertions, 0 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 | ||
| 60 | static 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 | |||
| 60 | static int __devinit mop500_of_probe(struct platform_device *pdev, | 74 | static 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 | |||
| 86 | static int __devinit mop500_probe(struct platform_device *pdev) | 102 | static 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 | } |
