diff options
-rw-r--r-- | sound/soc/samsung/i2s.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 27ca116ef31f..2bb35502b070 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c | |||
@@ -1107,6 +1107,11 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) | |||
1107 | return i2s; | 1107 | return i2s; |
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | static void i2s_free_sec_dai(struct i2s_dai *i2s) | ||
1111 | { | ||
1112 | platform_device_del(i2s->pdev); | ||
1113 | } | ||
1114 | |||
1110 | #ifdef CONFIG_PM | 1115 | #ifdef CONFIG_PM |
1111 | static int i2s_runtime_suspend(struct device *dev) | 1116 | static int i2s_runtime_suspend(struct device *dev) |
1112 | { | 1117 | { |
@@ -1340,17 +1345,27 @@ static int samsung_i2s_probe(struct platform_device *pdev) | |||
1340 | return -EINVAL; | 1345 | return -EINVAL; |
1341 | } | 1346 | } |
1342 | 1347 | ||
1343 | devm_snd_soc_register_component(&pri_dai->pdev->dev, | 1348 | ret = devm_snd_soc_register_component(&pri_dai->pdev->dev, |
1344 | &samsung_i2s_component, | 1349 | &samsung_i2s_component, |
1345 | &pri_dai->i2s_dai_drv, 1); | 1350 | &pri_dai->i2s_dai_drv, 1); |
1351 | if (ret < 0) | ||
1352 | goto err_free_dai; | ||
1353 | |||
1354 | ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter); | ||
1355 | if (ret < 0) | ||
1356 | goto err_free_dai; | ||
1346 | 1357 | ||
1347 | pm_runtime_enable(&pdev->dev); | 1358 | pm_runtime_enable(&pdev->dev); |
1348 | 1359 | ||
1349 | ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter); | 1360 | ret = i2s_register_clock_provider(pdev); |
1350 | if (ret != 0) | 1361 | if (!ret) |
1351 | return ret; | 1362 | return 0; |
1352 | 1363 | ||
1353 | return i2s_register_clock_provider(pdev); | 1364 | pm_runtime_disable(&pdev->dev); |
1365 | err_free_dai: | ||
1366 | if (sec_dai) | ||
1367 | i2s_free_sec_dai(sec_dai); | ||
1368 | return ret; | ||
1354 | } | 1369 | } |
1355 | 1370 | ||
1356 | static int samsung_i2s_remove(struct platform_device *pdev) | 1371 | static int samsung_i2s_remove(struct platform_device *pdev) |