diff options
Diffstat (limited to 'drivers/sound/emu10k1')
-rw-r--r-- | drivers/sound/emu10k1/audio.c | 22 | ||||
-rw-r--r-- | drivers/sound/emu10k1/ecard.h | 1 | ||||
-rw-r--r-- | drivers/sound/emu10k1/emu_wrapper.h | 5 | ||||
-rw-r--r-- | drivers/sound/emu10k1/main.c | 14 | ||||
-rw-r--r-- | drivers/sound/emu10k1/midi.c | 2 | ||||
-rw-r--r-- | drivers/sound/emu10k1/mixer.c | 8 |
6 files changed, 31 insertions, 21 deletions
diff --git a/drivers/sound/emu10k1/audio.c b/drivers/sound/emu10k1/audio.c index dca8d564d..9623dcb2e 100644 --- a/drivers/sound/emu10k1/audio.c +++ b/drivers/sound/emu10k1/audio.c @@ -361,7 +361,9 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned case SNDCTL_DSP_SPEED: DPF(2, "SNDCTL_DSP_SPEED:\n"); - get_user_ret(val, (int *) arg, -EFAULT); + if (get_user(val, (int *) arg)) + return -EFAULT; + DPD(2, "val is %d\n", val); if (val > 0) { @@ -415,7 +417,9 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned case SNDCTL_DSP_STEREO: DPF(2, "SNDCTL_DSP_STEREO:\n"); - get_user_ret(val, (int *) arg, -EFAULT); + if (get_user(val, (int *) arg)) + return -EFAULT; + DPD(2, " val is %d\n", val); if (file->f_mode & FMODE_READ) { @@ -460,7 +464,9 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned case SNDCTL_DSP_CHANNELS: DPF(2, "SNDCTL_DSP_CHANNELS:\n"); - get_user_ret(val, (int *) arg, -EFAULT); + if (get_user(val, (int *) arg)) + return -EFAULT; + DPD(2, " val is %d\n", val); if (val > 0) { @@ -522,7 +528,9 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned case SNDCTL_DSP_SETFMT: /* Same as SNDCTL_DSP_SAMPLESIZE */ DPF(2, "SNDCTL_DSP_SETFMT:\n"); - get_user_ret(val, (int *) arg, -EFAULT); + if (get_user(val, (int *) arg)) + return -EFAULT; + DPD(2, " val is %d\n", val); if (val != AFMT_QUERY) { @@ -624,7 +632,8 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned case SNDCTL_DSP_SETTRIGGER: DPF(2, "SNDCTL_DSP_SETTRIGGER:\n"); - get_user_ret(val, (int *) arg, -EFAULT); + if (get_user(val, (int *) arg)) + return -EFAULT; if (file->f_mode & FMODE_WRITE) { spin_lock_irqsave(&woinst->lock, flags); @@ -850,7 +859,8 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned case SNDCTL_DSP_SETFRAGMENT: DPF(2, "SNDCTL_DSP_SETFRAGMENT:\n"); - get_user_ret(val, (int *) arg, -EFAULT); + if (get_user(val, (int *) arg)) + return -EFAULT; DPD(2, "val is 0x%x\n", val); diff --git a/drivers/sound/emu10k1/ecard.h b/drivers/sound/emu10k1/ecard.h index 0d55960e1..c52ce3d85 100644 --- a/drivers/sound/emu10k1/ecard.h +++ b/drivers/sound/emu10k1/ecard.h @@ -29,6 +29,7 @@ #include "8010.h" #include "hwaccess.h" #include <linux/init.h> +#include <linux/sched.h> /* In A1 Silicon, these bits are in the HC register */ #define HOOKN_BIT (1L << 12) diff --git a/drivers/sound/emu10k1/emu_wrapper.h b/drivers/sound/emu10k1/emu_wrapper.h index 20cb56464..3a9862832 100644 --- a/drivers/sound/emu10k1/emu_wrapper.h +++ b/drivers/sound/emu10k1/emu_wrapper.h @@ -5,9 +5,4 @@ #define PCI_SET_DMA_MASK(pdev,mask) (((pdev)->dma_mask) = (mask)) -#ifndef PCI_GET_DRIVER_DATA - #define PCI_GET_DRIVER_DATA(pdev) ((pdev)->driver_data) - #define PCI_SET_DRIVER_DATA(pdev,data) (((pdev)->driver_data) = (data)) -#endif /* PCI_GET_DRIVER_DATA */ - #endif diff --git a/drivers/sound/emu10k1/main.c b/drivers/sound/emu10k1/main.c index c8ddfb2b4..20d35fa20 100644 --- a/drivers/sound/emu10k1/main.c +++ b/drivers/sound/emu10k1/main.c @@ -121,14 +121,14 @@ static void __devinit audio_init(struct emu10k1_card *card) /* stereo voice */ card->waveout.send_a[1] = 0x00; - card->waveout.send_b[1] = 0xff; - card->waveout.send_c[1] = 0x00; + card->waveout.send_b[1] = 0x00; + card->waveout.send_c[1] = 0xff; card->waveout.send_d[1] = 0x00; card->waveout.send_routing[1] = 0xd01c; card->waveout.send_a[2] = 0x00; - card->waveout.send_b[2] = 0x00; - card->waveout.send_c[2] = 0xff; + card->waveout.send_b[2] = 0xff; + card->waveout.send_c[2] = 0x00; card->waveout.send_d[2] = 0x00; card->waveout.send_routing[2] = 0xd01c; @@ -641,7 +641,7 @@ static int __devinit emu10k1_probe(struct pci_dev *pci_dev, const struct pci_dev return -ENODEV; } - PCI_SET_DRIVER_DATA(pci_dev, card); + pci_set_drvdata(pci_dev, card); PCI_SET_DMA_MASK(pci_dev, EMU10K1_DMA_MASK); card->irq = pci_dev->irq; @@ -736,7 +736,7 @@ static int __devinit emu10k1_probe(struct pci_dev *pci_dev, const struct pci_dev static void __devexit emu10k1_remove(struct pci_dev *pci_dev) { - struct emu10k1_card *card = PCI_GET_DRIVER_DATA(pci_dev); + struct emu10k1_card *card = pci_get_drvdata(pci_dev); midi_exit(card); emu10k1_exit(card); @@ -755,7 +755,7 @@ static void __devexit emu10k1_remove(struct pci_dev *pci_dev) kfree(card); - return; + pci_set_drvdata(pci_dev, NULL); } MODULE_AUTHOR("Bertrand Lee, Cai Ying. (Email to: emu10k1-devel@opensource.creative.com)"); diff --git a/drivers/sound/emu10k1/midi.c b/drivers/sound/emu10k1/midi.c index f94d3b6a4..f1e69dc70 100644 --- a/drivers/sound/emu10k1/midi.c +++ b/drivers/sound/emu10k1/midi.c @@ -43,7 +43,7 @@ #include "cardmi.h" #include "midi.h" -static spinlock_t midi_spinlock = SPIN_LOCK_UNLOCKED; +static spinlock_t midi_spinlock __attribute((unused)) = SPIN_LOCK_UNLOCKED; static void init_midi_hdr(struct midi_hdr *midihdr) { diff --git a/drivers/sound/emu10k1/mixer.c b/drivers/sound/emu10k1/mixer.c index f28787f87..a80b9d19a 100644 --- a/drivers/sound/emu10k1/mixer.c +++ b/drivers/sound/emu10k1/mixer.c @@ -1038,7 +1038,9 @@ static int emu10k1_mixer_ioctl(struct inode *inode, struct file *file, unsigned if (card->isaps) return -EINVAL; - get_user_ret(val, (int *) arg, -EFAULT); + if (get_user(val, (int *) arg)) + return -EFAULT; + i = hweight32(val); if (i == 0) return 0; /* val = mixer_recmask(s); */ @@ -1062,7 +1064,9 @@ static int emu10k1_mixer_ioctl(struct inode *inode, struct file *file, unsigned if (i >= SOUND_MIXER_NRDEVICES) return -EINVAL; - get_user_ret(val, (int *) arg, -EFAULT); + if (get_user(val, (int *) arg)) + return -EFAULT; + if (emu10k1_mixer_wrch(card, i, val)) return -EINVAL; |