diff options
Diffstat (limited to 'sound/usb/usx2y/usX2Yhwdep.c')
-rw-r--r-- | sound/usb/usx2y/usX2Yhwdep.c | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c index 1558a5c4094f..f3d8f71265dd 100644 --- a/sound/usb/usx2y/usX2Yhwdep.c +++ b/sound/usb/usx2y/usX2Yhwdep.c | |||
@@ -30,9 +30,6 @@ | |||
30 | #include "usbusx2y.h" | 30 | #include "usbusx2y.h" |
31 | #include "usX2Yhwdep.h" | 31 | #include "usX2Yhwdep.h" |
32 | 32 | ||
33 | int usX2Y_hwdep_pcm_new(struct snd_card *card); | ||
34 | |||
35 | |||
36 | static int snd_us428ctls_vm_fault(struct vm_area_struct *area, | 33 | static int snd_us428ctls_vm_fault(struct vm_area_struct *area, |
37 | struct vm_fault *vmf) | 34 | struct vm_fault *vmf) |
38 | { | 35 | { |
@@ -106,16 +103,6 @@ static unsigned int snd_us428ctls_poll(struct snd_hwdep *hw, struct file *file, | |||
106 | } | 103 | } |
107 | 104 | ||
108 | 105 | ||
109 | static int snd_usX2Y_hwdep_open(struct snd_hwdep *hw, struct file *file) | ||
110 | { | ||
111 | return 0; | ||
112 | } | ||
113 | |||
114 | static int snd_usX2Y_hwdep_release(struct snd_hwdep *hw, struct file *file) | ||
115 | { | ||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | static int snd_usX2Y_hwdep_dsp_status(struct snd_hwdep *hw, | 106 | static int snd_usX2Y_hwdep_dsp_status(struct snd_hwdep *hw, |
120 | struct snd_hwdep_dsp_status *info) | 107 | struct snd_hwdep_dsp_status *info) |
121 | { | 108 | { |
@@ -216,13 +203,12 @@ static int snd_usX2Y_hwdep_dsp_load(struct snd_hwdep *hw, | |||
216 | 203 | ||
217 | if (access_ok(VERIFY_READ, dsp->image, dsp->length)) { | 204 | if (access_ok(VERIFY_READ, dsp->image, dsp->length)) { |
218 | struct usb_device* dev = priv->chip.dev; | 205 | struct usb_device* dev = priv->chip.dev; |
219 | char *buf = kmalloc(dsp->length, GFP_KERNEL); | 206 | char *buf; |
220 | if (!buf) | 207 | |
221 | return -ENOMEM; | 208 | buf = memdup_user(dsp->image, dsp->length); |
222 | if (copy_from_user(buf, dsp->image, dsp->length)) { | 209 | if (IS_ERR(buf)) |
223 | kfree(buf); | 210 | return PTR_ERR(buf); |
224 | return -EFAULT; | 211 | |
225 | } | ||
226 | err = usb_set_interface(dev, 0, 1); | 212 | err = usb_set_interface(dev, 0, 1); |
227 | if (err) | 213 | if (err) |
228 | snd_printk(KERN_ERR "usb_set_interface error \n"); | 214 | snd_printk(KERN_ERR "usb_set_interface error \n"); |
@@ -267,8 +253,6 @@ int usX2Y_hwdep_new(struct snd_card *card, struct usb_device* device) | |||
267 | 253 | ||
268 | hw->iface = SNDRV_HWDEP_IFACE_USX2Y; | 254 | hw->iface = SNDRV_HWDEP_IFACE_USX2Y; |
269 | hw->private_data = usX2Y(card); | 255 | hw->private_data = usX2Y(card); |
270 | hw->ops.open = snd_usX2Y_hwdep_open; | ||
271 | hw->ops.release = snd_usX2Y_hwdep_release; | ||
272 | hw->ops.dsp_status = snd_usX2Y_hwdep_dsp_status; | 256 | hw->ops.dsp_status = snd_usX2Y_hwdep_dsp_status; |
273 | hw->ops.dsp_load = snd_usX2Y_hwdep_dsp_load; | 257 | hw->ops.dsp_load = snd_usX2Y_hwdep_dsp_load; |
274 | hw->ops.mmap = snd_us428ctls_mmap; | 258 | hw->ops.mmap = snd_us428ctls_mmap; |