]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: imx-audmix: register the card on a proper dev
authorShengjiu Wang <shengjiu.wang@nxp.com>
Tue, 27 Aug 2019 15:55:15 +0000 (11:55 -0400)
committerMark Brown <broonie@kernel.org>
Tue, 27 Aug 2019 10:44:39 +0000 (11:44 +0100)
This platform device is registered from "fsl_audmix", which is
its parent device. If use pdev->dev.parent for the priv->card.dev,
the value set by dev_set_drvdata in parent device will be covered
by the value in child device.

Fixes: f9cef5322203 ("ASoC: fsl: Add Audio Mixer machine driver")
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/1566921315-23402-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/imx-audmix.c

index 9e1cb18859ce6a585a2956dc11737ebc7978f466..71590ca6394b97c7e6ccd62ababe889101fca475 100644 (file)
@@ -325,14 +325,14 @@ static int imx_audmix_probe(struct platform_device *pdev)
        priv->card.num_configs = priv->num_dai_conf;
        priv->card.dapm_routes = priv->dapm_routes;
        priv->card.num_dapm_routes = priv->num_dapm_routes;
-       priv->card.dev = pdev->dev.parent;
+       priv->card.dev = &pdev->dev;
        priv->card.owner = THIS_MODULE;
        priv->card.name = "imx-audmix";
 
        platform_set_drvdata(pdev, &priv->card);
        snd_soc_card_set_drvdata(&priv->card, priv);
 
-       ret = devm_snd_soc_register_card(pdev->dev.parent, &priv->card);
+       ret = devm_snd_soc_register_card(&pdev->dev, &priv->card);
        if (ret) {
                dev_err(&pdev->dev, "snd_soc_register_card failed\n");
                return ret;