aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/function/u_uac1_legacy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/function/u_uac1_legacy.c')
-rw-r--r--drivers/usb/gadget/function/u_uac1_legacy.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/usb/gadget/function/u_uac1_legacy.c b/drivers/usb/gadget/function/u_uac1_legacy.c
index 8aa76b4dc117..fa4684a1c54c 100644
--- a/drivers/usb/gadget/function/u_uac1_legacy.c
+++ b/drivers/usb/gadget/function/u_uac1_legacy.c
@@ -157,7 +157,6 @@ size_t u_audio_playback(struct gaudio *card, void *buf, size_t count)
157 struct gaudio_snd_dev *snd = &card->playback; 157 struct gaudio_snd_dev *snd = &card->playback;
158 struct snd_pcm_substream *substream = snd->substream; 158 struct snd_pcm_substream *substream = snd->substream;
159 struct snd_pcm_runtime *runtime = substream->runtime; 159 struct snd_pcm_runtime *runtime = substream->runtime;
160 mm_segment_t old_fs;
161 ssize_t result; 160 ssize_t result;
162 snd_pcm_sframes_t frames; 161 snd_pcm_sframes_t frames;
163 162
@@ -174,15 +173,11 @@ try_again:
174 } 173 }
175 174
176 frames = bytes_to_frames(runtime, count); 175 frames = bytes_to_frames(runtime, count);
177 old_fs = get_fs(); 176 result = snd_pcm_kernel_write(snd->substream, buf, frames);
178 set_fs(KERNEL_DS);
179 result = snd_pcm_lib_write(snd->substream, (void __user *)buf, frames);
180 if (result != frames) { 177 if (result != frames) {
181 ERROR(card, "Playback error: %d\n", (int)result); 178 ERROR(card, "Playback error: %d\n", (int)result);
182 set_fs(old_fs);
183 goto try_again; 179 goto try_again;
184 } 180 }
185 set_fs(old_fs);
186 181
187 return 0; 182 return 0;
188} 183}