diff mbox series

[3/5] ASoC: amd: Avoid passing NULL to memory allocators

Message ID 20190204134222.9560-4-tiwai@suse.de (mailing list archive)
State New, archived
Headers show
Series ALSA: Fix remaining NULL device with memory allocations | expand

Commit Message

Takashi Iwai Feb. 4, 2019, 1:42 p.m. UTC
We should pass a proper non-NULL device object to memory allocators
although it was accepted in the past.  The card->dev points to the
most appropriate device object in such a case, so let's put it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/amd/raven/acp3x-pcm-dma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Mark Brown Feb. 4, 2019, 9 p.m. UTC | #1
On Mon, Feb 04, 2019 at 02:42:20PM +0100, Takashi Iwai wrote:
> We should pass a proper non-NULL device object to memory allocators
> although it was accepted in the past.  The card->dev points to the
> most appropriate device object in such a case, so let's put it.

Acked-by: Mark Brown <broonie@kernel.org>
diff mbox series

Patch

diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c
index 3d58338fa3cf..3e7d4099364c 100644
--- a/sound/soc/amd/raven/acp3x-pcm-dma.c
+++ b/sound/soc/amd/raven/acp3x-pcm-dma.c
@@ -369,7 +369,8 @@  static int acp3x_dma_new(struct snd_soc_pcm_runtime *rtd)
 {
 	return snd_pcm_lib_preallocate_pages_for_all(rtd->pcm,
 						     SNDRV_DMA_TYPE_DEV,
-						     NULL, MIN_BUFFER,
+						     rtd->pcm->card->dev,
+						     MIN_BUFFER,
 						     MAX_BUFFER);
 }