Skip to content

Commit

Permalink
ALSA: core: Drop snd_sgbuf_get_ptr()
Browse files Browse the repository at this point in the history
snd_sgbuf_get_ptr() and its sibling snd_pcm_sgbuf_get_ptr() are no
longer used by any drivers.  Let's drop them.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jun 10, 2021
1 parent 74fb983 commit 84a0374
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
19 changes: 0 additions & 19 deletions include/sound/memalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,6 @@ static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab,
return addr + offset % PAGE_SIZE;
}

/*
* return the virtual address at the corresponding offset
*/
static inline void *snd_sgbuf_get_ptr(struct snd_dma_buffer *dmab,
size_t offset)
{
struct snd_sg_buf *sgbuf = dmab->private_data;

if (!sgbuf)
return dmab->area + offset;
return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE;
}

unsigned int snd_sgbuf_get_chunk_size(struct snd_dma_buffer *dmab,
unsigned int ofs, unsigned int size);
#else
Expand All @@ -126,12 +113,6 @@ static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab,
return dmab->addr + offset;
}

static inline void *snd_sgbuf_get_ptr(struct snd_dma_buffer *dmab,
size_t offset)
{
return dmab->area + offset;
}

#define snd_sgbuf_get_chunk_size(dmab, ofs, size) (size)

#endif /* CONFIG_SND_DMA_SGBUF */
Expand Down
11 changes: 0 additions & 11 deletions include/sound/pcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1273,17 +1273,6 @@ snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs)
return snd_sgbuf_get_addr(snd_pcm_get_dma_buf(substream), ofs);
}

/**
* snd_pcm_sgbuf_get_ptr - Get the virtual address at the corresponding offset
* @substream: PCM substream
* @ofs: byte offset
*/
static inline void *
snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs)
{
return snd_sgbuf_get_ptr(snd_pcm_get_dma_buf(substream), ofs);
}

/**
* snd_pcm_sgbuf_get_chunk_size - Compute the max size that fits within the
* contig. page from the given size
Expand Down

0 comments on commit 84a0374

Please sign in to comment.