static int snd_rme9652_playback_copy(struct snd_pcm_substream *substream,
int channel, unsigned long pos,
- void __user *src, unsigned long count)
+ struct iov_iter *src, unsigned long count)
{
struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream);
signed char *channel_buf;
channel);
if (snd_BUG_ON(!channel_buf))
return -EIO;
- if (copy_from_user(channel_buf + pos, src, count))
+ if (copy_from_iter(channel_buf + pos, count, src) != count)
return -EFAULT;
return 0;
}
-static int snd_rme9652_playback_copy_kernel(struct snd_pcm_substream *substream,
- int channel, unsigned long pos,
- void *src, unsigned long count)
-{
- struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream);
- signed char *channel_buf;
-
- channel_buf = rme9652_channel_buffer_location(rme9652,
- substream->pstr->stream,
- channel);
- if (snd_BUG_ON(!channel_buf))
- return -EIO;
- memcpy(channel_buf + pos, src, count);
- return 0;
-}
-
static int snd_rme9652_capture_copy(struct snd_pcm_substream *substream,
int channel, unsigned long pos,
- void __user *dst, unsigned long count)
+ struct iov_iter *dst, unsigned long count)
{
struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream);
signed char *channel_buf;
channel);
if (snd_BUG_ON(!channel_buf))
return -EIO;
- if (copy_to_user(dst, channel_buf + pos, count))
+ if (copy_to_iter(channel_buf + pos, count, dst) != count)
return -EFAULT;
return 0;
}
-static int snd_rme9652_capture_copy_kernel(struct snd_pcm_substream *substream,
- int channel, unsigned long pos,
- void *dst, unsigned long count)
-{
- struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream);
- signed char *channel_buf;
-
- channel_buf = rme9652_channel_buffer_location(rme9652,
- substream->pstr->stream,
- channel);
- if (snd_BUG_ON(!channel_buf))
- return -EIO;
- memcpy(dst, channel_buf + pos, count);
- return 0;
-}
-
static int snd_rme9652_hw_silence(struct snd_pcm_substream *substream,
int channel, unsigned long pos,
unsigned long count)
.prepare = snd_rme9652_prepare,
.trigger = snd_rme9652_trigger,
.pointer = snd_rme9652_hw_pointer,
- .copy_user = snd_rme9652_playback_copy,
- .copy_kernel = snd_rme9652_playback_copy_kernel,
+ .copy = snd_rme9652_playback_copy,
.fill_silence = snd_rme9652_hw_silence,
};
.prepare = snd_rme9652_prepare,
.trigger = snd_rme9652_trigger,
.pointer = snd_rme9652_hw_pointer,
- .copy_user = snd_rme9652_capture_copy,
- .copy_kernel = snd_rme9652_capture_copy_kernel,
+ .copy = snd_rme9652_capture_copy,
};
static int snd_rme9652_create_pcm(struct snd_card *card,