]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ASoC: Intel: cht_bsw_rt5672: fix kernel oops with platform_name override
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 4 Jun 2019 20:08:58 +0000 (15:08 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jul 2019 07:52:25 +0000 (09:52 +0200)
[ Upstream commit 9bbc799318a34061703f2a980e2b6df7fc6760f0 ]

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: f403906da05cd ("ASoC: Intel: cht_bsw_rt5672: platform name fixup support")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/intel/boards/cht_bsw_rt5672.c

index 3d5a2b3a06f0816201a8fca6e9040f6a34dd3e72..87ce3857376dc7bf714687a17fb2eebb8cbf5cb5 100644 (file)
@@ -425,6 +425,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
        }
 
        /* override plaform name, if required */
+       snd_soc_card_cht.dev = &pdev->dev;
        platform_name = mach->mach_params.platform;
 
        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)
        snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
 
        /* register the soc card */
-       snd_soc_card_cht.dev = &pdev->dev;
        ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht);
        if (ret_val) {
                dev_err(&pdev->dev,