From: Pierre-Louis Bossart Date: Tue, 4 Jun 2019 20:08:57 +0000 (-0500) Subject: ASoC: Intel: cht_bsw_nau8824: fix kernel oops with platform_name override X-Git-Tag: v5.4-rc1~712^2~8^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=096701e8131425044d2054a0c210d6ea24ee7386;p=platform%2Fkernel%2Flinux-rpi.git ASoC: Intel: cht_bsw_nau8824: fix kernel oops with platform_name override 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: 4506db8043341 ("ASoC: Intel: cht_bsw_nau8824: platform name fixup support") Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown --- diff --git a/sound/soc/intel/boards/cht_bsw_nau8824.c b/sound/soc/intel/boards/cht_bsw_nau8824.c index 02c2fa2..20fae39 100644 --- a/sound/soc/intel/boards/cht_bsw_nau8824.c +++ b/sound/soc/intel/boards/cht_bsw_nau8824.c @@ -257,6 +257,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) snd_soc_card_set_drvdata(&snd_soc_card_cht, drv); /* override plaform name, if required */ + snd_soc_card_cht.dev = &pdev->dev; mach = (&pdev->dev)->platform_data; platform_name = mach->mach_params.platform; @@ -266,7 +267,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev) return ret_val; /* 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,