aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/wavefront/wavefront_fx.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/wavefront/wavefront_fx.c')
-rw-r--r--sound/isa/wavefront/wavefront_fx.c30
1 files changed, 5 insertions, 25 deletions
diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c
index dfc449a2194e..2bb1cee09255 100644
--- a/sound/isa/wavefront/wavefront_fx.c
+++ b/sound/isa/wavefront/wavefront_fx.c
@@ -34,14 +34,6 @@
34 34
35#define WAIT_IDLE 0xff 35#define WAIT_IDLE 0xff
36 36
37#ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
38#include "yss225.c"
39static const struct firmware yss225_registers_firmware = {
40 .data = (u8 *)yss225_registers,
41 .size = sizeof yss225_registers
42};
43#endif
44
45static int 37static int
46wavefront_fx_idle (snd_wavefront_t *dev) 38wavefront_fx_idle (snd_wavefront_t *dev)
47 39
@@ -210,15 +202,11 @@ snd_wavefront_fx_ioctl (struct snd_hwdep *sdev, struct file *file,
210 "> 512 bytes to FX\n"); 202 "> 512 bytes to FX\n");
211 return -EIO; 203 return -EIO;
212 } 204 }
213 page_data = kmalloc(r.data[2] * sizeof(short), GFP_KERNEL); 205 page_data = memdup_user((unsigned char __user *)
214 if (!page_data) 206 r.data[3],
215 return -ENOMEM; 207 r.data[2] * sizeof(short));
216 if (copy_from_user (page_data, 208 if (IS_ERR(page_data))
217 (unsigned char __user *) r.data[3], 209 return PTR_ERR(page_data);
218 r.data[2] * sizeof(short))) {
219 kfree(page_data);
220 return -EFAULT;
221 }
222 pd = page_data; 210 pd = page_data;
223 } 211 }
224 212
@@ -260,16 +248,12 @@ snd_wavefront_fx_start (snd_wavefront_t *dev)
260 if (dev->fx_initialized) 248 if (dev->fx_initialized)
261 return 0; 249 return 0;
262 250
263#ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
264 firmware = &yss225_registers_firmware;
265#else
266 err = request_firmware(&firmware, "yamaha/yss225_registers.bin", 251 err = request_firmware(&firmware, "yamaha/yss225_registers.bin",
267 dev->card->dev); 252 dev->card->dev);
268 if (err < 0) { 253 if (err < 0) {
269 err = -1; 254 err = -1;
270 goto out; 255 goto out;
271 } 256 }
272#endif
273 257
274 for (i = 0; i + 1 < firmware->size; i += 2) { 258 for (i = 0; i + 1 < firmware->size; i += 2) {
275 if (firmware->data[i] >= 8 && firmware->data[i] < 16) { 259 if (firmware->data[i] >= 8 && firmware->data[i] < 16) {
@@ -292,12 +276,8 @@ snd_wavefront_fx_start (snd_wavefront_t *dev)
292 err = 0; 276 err = 0;
293 277
294out: 278out:
295#ifndef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
296 release_firmware(firmware); 279 release_firmware(firmware);
297#endif
298 return err; 280 return err;
299} 281}
300 282
301#ifndef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
302MODULE_FIRMWARE("yamaha/yss225_registers.bin"); 283MODULE_FIRMWARE("yamaha/yss225_registers.bin");
303#endif