aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2016-06-02 05:55:24 -0400
committerMark Brown <broonie@kernel.org>2016-06-02 05:58:19 -0400
commit272ee030ebc9da58a5796e6e26f78b77ecce7c21 (patch)
tree09ce9ad550360aff537f1e30eec3de3c2473abbe
parent9ac0013ce6744fb49d961e592e1339ab1453b914 (diff)
ASoC: davinci-mcasp: Use a copy of pdata per instance during DT boot
Instead of modifying the static pdata struct per McASP instance we need to allocate pdata for each McASP. This way we can avoid configuration leakage from prior McASP to McASP drivers probed at later time. Reported-by: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/davinci/davinci-mcasp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 237dc67002ef..05c2d33aa74d 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -1599,7 +1599,14 @@ static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of(
1599 pdata = pdev->dev.platform_data; 1599 pdata = pdev->dev.platform_data;
1600 return pdata; 1600 return pdata;
1601 } else if (match) { 1601 } else if (match) {
1602 pdata = (struct davinci_mcasp_pdata*) match->data; 1602 pdata = devm_kmemdup(&pdev->dev, match->data, sizeof(*pdata),
1603 GFP_KERNEL);
1604 if (!pdata) {
1605 dev_err(&pdev->dev,
1606 "Failed to allocate memory for pdata\n");
1607 ret = -ENOMEM;
1608 return pdata;
1609 }
1603 } else { 1610 } else {
1604 /* control shouldn't reach here. something is wrong */ 1611 /* control shouldn't reach here. something is wrong */
1605 ret = -EINVAL; 1612 ret = -EINVAL;