Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 272ee030 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown
Browse files

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: default avatarMisael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9ac0013c
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1599,7 +1599,14 @@ static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of(
		pdata = pdev->dev.platform_data;
		return pdata;
	} else if (match) {
		pdata = (struct davinci_mcasp_pdata*) match->data;
		pdata = devm_kmemdup(&pdev->dev, match->data, sizeof(*pdata),
				     GFP_KERNEL);
		if (!pdata) {
			dev_err(&pdev->dev,
				"Failed to allocate memory for pdata\n");
			ret = -ENOMEM;
			return pdata;
		}
	} else {
		/* control shouldn't reach here. something is wrong */
		ret = -EINVAL;