Skip to content

Commit 69d0fd3

Browse files
committed
ASoC: dmaengine: Drop unused iov_iter for process callback
Passing the iov_iter to the process callback is rather buggy, as the iterator has been already processed for playback. Similarly, it makes the copy for capture buggy after the process callback reading the iterator out. Moreover, all existing process callbacks don't refer to the passed iterator at all. So, it's better to drop the argument from the process callback. Fixes: 9bebd65 ("ASoC: dmaengine: Use iov_iter for process callback, too") Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/CAHk-=wje+VkXjjfVTmK-uJdG_M5=ar14QxAwK+XDiq07k_pzBg@mail.gmail.com Reviewed-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230831130457.8180-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent da42bcb commit 69d0fd3

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

include/sound/dmaengine_pcm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ struct snd_dmaengine_pcm_config {
142142
struct snd_pcm_substream *substream);
143143
int (*process)(struct snd_pcm_substream *substream,
144144
int channel, unsigned long hwoff,
145-
struct iov_iter *buf, unsigned long bytes);
145+
unsigned long bytes);
146146
dma_filter_fn compat_filter_fn;
147147
struct device *dma_dev;
148148
const char *chan_names[SNDRV_PCM_STREAM_LAST + 1];

sound/soc/atmel/mchp-pdmc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ static int mchp_pdmc_dt_init(struct mchp_pdmc *dd)
954954
/* used to clean the channel index found on RHR's MSB */
955955
static int mchp_pdmc_process(struct snd_pcm_substream *substream,
956956
int channel, unsigned long hwoff,
957-
struct iov_iter *buf, unsigned long bytes)
957+
unsigned long bytes)
958958
{
959959
struct snd_pcm_runtime *runtime = substream->runtime;
960960
u8 *dma_ptr = runtime->dma_area + hwoff +

sound/soc/soc-generic-dmaengine-pcm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static int dmaengine_copy(struct snd_soc_component *component,
296296
struct dmaengine_pcm *pcm = soc_component_to_pcm(component);
297297
int (*process)(struct snd_pcm_substream *substream,
298298
int channel, unsigned long hwoff,
299-
struct iov_iter *buf, unsigned long bytes) = pcm->config->process;
299+
unsigned long bytes) = pcm->config->process;
300300
bool is_playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
301301
void *dma_ptr = runtime->dma_area + hwoff +
302302
channel * (runtime->dma_bytes / runtime->channels);
@@ -306,7 +306,7 @@ static int dmaengine_copy(struct snd_soc_component *component,
306306
return -EFAULT;
307307

308308
if (process) {
309-
int ret = process(substream, channel, hwoff, buf, bytes);
309+
int ret = process(substream, channel, hwoff, bytes);
310310
if (ret < 0)
311311
return ret;
312312
}

sound/soc/stm/stm32_sai_sub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ static const struct snd_soc_dai_ops stm32_sai_pcm_dai_ops2 = {
12461246

12471247
static int stm32_sai_pcm_process_spdif(struct snd_pcm_substream *substream,
12481248
int channel, unsigned long hwoff,
1249-
struct iov_iter *buf, unsigned long bytes)
1249+
unsigned long bytes)
12501250
{
12511251
struct snd_pcm_runtime *runtime = substream->runtime;
12521252
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);

0 commit comments

Comments
 (0)