Re: [PATCH] ASoC: imx-audmix: register the card on a proper dev

2019-08-27 Thread Daniel Baluta
On Tue, 2019-08-27 at 11:55 -0400, Shengjiu Wang wrote:
> 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: b86ef5367761 ("ASoC: fsl: Add Audio Mixer machine driver")
> Signed-off-by: Viorel Suman 
> Signed-off-by: Shengjiu Wang 

Reviewed-by: Daniel Baluta 

Thanks Shengjiu for the fix!

> ---
>  sound/soc/fsl/imx-audmix.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/fsl/imx-audmix.c b/sound/soc/fsl/imx-audmix.c
> index 9e1cb18859ce..71590ca6394b 100644
> --- a/sound/soc/fsl/imx-audmix.c
> +++ b/sound/soc/fsl/imx-audmix.c
> @@ -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 = >dev;
>   priv->card.owner = THIS_MODULE;
>   priv->card.name = "imx-audmix";
>  
>   platform_set_drvdata(pdev, >card);
>   snd_soc_card_set_drvdata(>card, priv);
>  
> - ret = devm_snd_soc_register_card(pdev->dev.parent, 
> >card);
> + ret = devm_snd_soc_register_card(>dev, >card);
>   if (ret) {
>   dev_err(>dev, "snd_soc_register_card failed\n");
>   return ret;


[PATCH] ASoC: imx-audmix: register the card on a proper dev

2019-08-26 Thread Shengjiu Wang
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: b86ef5367761 ("ASoC: fsl: Add Audio Mixer machine driver")
Signed-off-by: Viorel Suman 
Signed-off-by: Shengjiu Wang 
---
 sound/soc/fsl/imx-audmix.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/imx-audmix.c b/sound/soc/fsl/imx-audmix.c
index 9e1cb18859ce..71590ca6394b 100644
--- a/sound/soc/fsl/imx-audmix.c
+++ b/sound/soc/fsl/imx-audmix.c
@@ -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 = >dev;
priv->card.owner = THIS_MODULE;
priv->card.name = "imx-audmix";
 
platform_set_drvdata(pdev, >card);
snd_soc_card_set_drvdata(>card, priv);
 
-   ret = devm_snd_soc_register_card(pdev->dev.parent, >card);
+   ret = devm_snd_soc_register_card(>dev, >card);
if (ret) {
dev_err(>dev, "snd_soc_register_card failed\n");
return ret;
-- 
2.21.0