ALSA: dummy: Convert to generic PCM copy ops
authorTakashi Iwai <tiwai@suse.de>
Tue, 15 Aug 2023 19:01:15 +0000 (21:01 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 18 Aug 2023 10:18:17 +0000 (12:18 +0200)
This patch converts the dummy driver code to use the new unified PCM
copy callback.  As dummy driver doesn't do anything in the callback,
it's just a simple replacement.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230815190136.8987-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/drivers/dummy.c

index 9c17b49a2ae1c98d06a2f8ec9d434b638e698948..4317677ba24aafbf76ec2e3f58de0164162c3d00 100644 (file)
@@ -626,14 +626,7 @@ static int alloc_fake_buffer(void)
 
 static int dummy_pcm_copy(struct snd_pcm_substream *substream,
                          int channel, unsigned long pos,
-                         void __user *dst, unsigned long bytes)
-{
-       return 0; /* do nothing */
-}
-
-static int dummy_pcm_copy_kernel(struct snd_pcm_substream *substream,
-                                int channel, unsigned long pos,
-                                void *dst, unsigned long bytes)
+                         struct iov_iter *iter, unsigned long bytes)
 {
        return 0; /* do nothing */
 }
@@ -667,8 +660,7 @@ static const struct snd_pcm_ops dummy_pcm_ops_no_buf = {
        .prepare =      dummy_pcm_prepare,
        .trigger =      dummy_pcm_trigger,
        .pointer =      dummy_pcm_pointer,
-       .copy_user =    dummy_pcm_copy,
-       .copy_kernel =  dummy_pcm_copy_kernel,
+       .copy =         dummy_pcm_copy,
        .fill_silence = dummy_pcm_silence,
        .page =         dummy_pcm_page,
 };