ASoC: mediatek: preallocate pages use platform device
authorKai Chieh Chuang <kaichieh.chuang@mediatek.com>
Fri, 27 Apr 2018 02:11:35 +0000 (10:11 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 27 Apr 2018 10:58:23 +0000 (11:58 +0100)
preallocate pages should use platform device,
since we set dma mask for platform device.

Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/common/mtk-afe-platform-driver.c

index 404fbe19e1a38b4cb4b6ba13e209e9b793d8bf5f..d046ea8e543bd96097740c7ae58f0cf4c8242fad 100644 (file)
@@ -56,14 +56,14 @@ static const struct snd_pcm_ops mtk_afe_pcm_ops = {
 static int mtk_afe_pcm_new(struct snd_soc_pcm_runtime *rtd)
 {
        size_t size;
-       struct snd_card *card = rtd->card->snd_card;
        struct snd_pcm *pcm = rtd->pcm;
        struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME);
        struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component);
 
        size = afe->mtk_afe_hardware->buffer_bytes_max;
        return snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
-                                                    card->dev, size, size);
+                                                    rtd->platform->dev,
+                                                    size, size);
 }
 
 static void mtk_afe_pcm_free(struct snd_pcm *pcm)