Commit 54f49e22 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Greg Kroah-Hartman

ASoC: Intel: cht_bsw_rt5672: fix kernel oops with platform_name override

[ Upstream commit 9bbc7993 ]

The platform override code uses devm_ functions to allocate memory for
the new name but the card device is not initialized. Fix by moving the
init earlier.

Fixes: f403906d ("ASoC: Intel: cht_bsw_rt5672: platform name fixup support")
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 1cdfe188
...@@ -425,6 +425,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) ...@@ -425,6 +425,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
} }
/* override plaform name, if required */ /* override plaform name, if required */
snd_soc_card_cht.dev = &pdev->dev;
platform_name = mach->mach_params.platform; platform_name = mach->mach_params.platform;
ret_val = snd_soc_fixup_dai_links_platform_name(&snd_soc_card_cht, ret_val = snd_soc_fixup_dai_links_platform_name(&snd_soc_card_cht,
...@@ -442,7 +443,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev) ...@@ -442,7 +443,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
snd_soc_card_set_drvdata(&snd_soc_card_cht, drv); snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
/* register the soc card */ /* register the soc card */
snd_soc_card_cht.dev = &pdev->dev;
ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht); ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht);
if (ret_val) { if (ret_val) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment