diff options
author | Takashi Iwai <tiwai@suse.de> | 2022-09-06 11:04:03 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2022-09-06 11:04:15 +0200 |
commit | 16c5cde20e304cd900371b140cd53ecafe8d3de5 (patch) | |
tree | e1ece341f2ef3ac98069c3fcb350e16f0a8645bb /sound/core/memalloc.c | |
parent | 32eeeed963ad4f41b422b3e314d96ded7283b201 (diff) | |
parent | 37137ec26c2c03039d8064c00f6eae176841ee0d (diff) |
Merge branch 'for-linus' into for-next
Once again back-merge the 6.0-rc devel branch for further USB-audio
and HD-audio developments.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/memalloc.c')
-rw-r--r-- | sound/core/memalloc.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index 39561faef6e9..2c11413bea61 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c @@ -558,10 +558,13 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size) dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, sg_dma_address(sgt->sgl)); p = dma_vmap_noncontiguous(dmab->dev.dev, size, sgt); - if (p) + if (p) { dmab->private_data = sgt; - else + /* store the first page address for convenience */ + dmab->addr = snd_sgbuf_get_addr(dmab, 0); + } else { dma_free_noncontiguous(dmab->dev.dev, size, sgt, dmab->dev.dir); + } return p; } @@ -763,6 +766,8 @@ static void *snd_dma_sg_fallback_alloc(struct snd_dma_buffer *dmab, size_t size) if (!p) goto error; dmab->private_data = sgbuf; + /* store the first page address for convenience */ + dmab->addr = snd_sgbuf_get_addr(dmab, 0); return p; error: |