]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ASoC: stm32: fix sai driver name initialisation
authorArnaud Pouliquen <arnaud.pouliquen@st.com>
Fri, 5 Apr 2019 09:19:11 +0000 (11:19 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 8 Apr 2019 06:37:55 +0000 (13:37 +0700)
This patch fixes the sai driver structure overwriting which results in
a cpu dai name equal NULL.

Fixes: 3e086ed ("ASoC: stm32: add SAI driver")
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/stm/stm32_sai_sub.c

index 55d802f51c155701c7c51dd2420a08333f339a33..83d8a7ac56f42a5487343deaa223403f7f54a22b 100644 (file)
@@ -1419,7 +1419,6 @@ static int stm32_sai_sub_dais_init(struct platform_device *pdev,
        if (!sai->cpu_dai_drv)
                return -ENOMEM;
 
-       sai->cpu_dai_drv->name = dev_name(&pdev->dev);
        if (STM_SAI_IS_PLAYBACK(sai)) {
                memcpy(sai->cpu_dai_drv, &stm32_sai_playback_dai,
                       sizeof(stm32_sai_playback_dai));
@@ -1429,6 +1428,7 @@ static int stm32_sai_sub_dais_init(struct platform_device *pdev,
                       sizeof(stm32_sai_capture_dai));
                sai->cpu_dai_drv->capture.stream_name = sai->cpu_dai_drv->name;
        }
+       sai->cpu_dai_drv->name = dev_name(&pdev->dev);
 
        return 0;
 }