diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-10-05 01:18:40 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-10-05 01:18:40 +0000 |
commit | 012bb3e61e5eced6c610f9e036372bf0c8def2d1 (patch) | |
tree | 87efc733f9b164e8c85c0336f92c8fb7eff6d183 /drivers/sound/trident.c | |
parent | 625a1589d3d6464b5d90b8a0918789e3afffd220 (diff) |
Merge with Linux 2.4.0-test9. Please check DECstation, I had a number
of rejects to fixup while integrating Linus patches. I also found
that this kernel will only boot SMP on Origin; the UP kernel freeze
soon after bootup with SCSI timeout messages. I commit this anyway
since I found that the last CVS versions had the same problem.
Diffstat (limited to 'drivers/sound/trident.c')
-rw-r--r-- | drivers/sound/trident.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/drivers/sound/trident.c b/drivers/sound/trident.c index c85d40991..7ca4666e4 100644 --- a/drivers/sound/trident.c +++ b/drivers/sound/trident.c @@ -1633,7 +1633,8 @@ static int trident_ioctl(struct inode *inode, struct file *file, unsigned int cm return 0; case SNDCTL_DSP_SPEED: /* set smaple rate */ - get_user_ret(val, (int *)arg, -EFAULT); + if (get_user(val, (int *)arg)) + return -EFAULT; if (val >= 0) { if (file->f_mode & FMODE_WRITE) { stop_dac(state); @@ -1653,7 +1654,8 @@ static int trident_ioctl(struct inode *inode, struct file *file, unsigned int cm return put_user(dmabuf->rate, (int *)arg); case SNDCTL_DSP_STEREO: /* set stereo or mono channel */ - get_user_ret(val, (int *)arg, -EFAULT); + if (get_user(val, (int *)arg)) + return -EFAULT; if (file->f_mode & FMODE_WRITE) { stop_dac(state); dmabuf->ready = 0; @@ -1688,7 +1690,8 @@ static int trident_ioctl(struct inode *inode, struct file *file, unsigned int cm return put_user(AFMT_S16_LE|AFMT_U16_LE|AFMT_S8|AFMT_U8, (int *)arg); case SNDCTL_DSP_SETFMT: /* Select sample format */ - get_user_ret(val, (int *)arg, -EFAULT); + if (get_user(val, (int *)arg)) + return -EFAULT; if (val != AFMT_QUERY) { if (file->f_mode & FMODE_WRITE) { stop_dac(state); @@ -1711,7 +1714,8 @@ static int trident_ioctl(struct inode *inode, struct file *file, unsigned int cm AFMT_S16_LE : AFMT_U8, (int *)arg); case SNDCTL_DSP_CHANNELS: - get_user_ret(val, (int *)arg, -EFAULT); + if (get_user(val, (int *)arg)) + return -EFAULT; if (val != 0) { if (file->f_mode & FMODE_WRITE) { stop_dac(state); @@ -1740,14 +1744,16 @@ static int trident_ioctl(struct inode *inode, struct file *file, unsigned int cm case SNDCTL_DSP_SUBDIVIDE: if (dmabuf->subdivision) return -EINVAL; - get_user_ret(val, (int *)arg, -EFAULT); + if (get_user(val, (int *)arg)) + return -EFAULT; if (val != 1 && val != 2 && val != 4) return -EINVAL; dmabuf->subdivision = val; return 0; case SNDCTL_DSP_SETFRAGMENT: - get_user_ret(val, (int *)arg, -EFAULT); + if (get_user(val, (int *)arg)) + return -EFAULT; dmabuf->ossfragshift = val & 0xffff; dmabuf->ossmaxfrags = (val >> 16) & 0xffff; @@ -1805,7 +1811,8 @@ static int trident_ioctl(struct inode *inode, struct file *file, unsigned int cm return put_user(val, (int *)arg); case SNDCTL_DSP_SETTRIGGER: - get_user_ret(val, (int *)arg, -EFAULT); + if (get_user(val, (int *)arg)) + return -EFAULT; if (file->f_mode & FMODE_READ) { if (val & PCM_ENABLE_INPUT) { if (!dmabuf->ready && (ret = prog_dmabuf(state, 1))) @@ -1881,7 +1888,8 @@ static int trident_ioctl(struct inode *inode, struct file *file, unsigned int cm if (state->card->pci_id != PCI_DEVICE_ID_SI_7018) return -EINVAL; - get_user_ret(val, (int *)arg, -EFAULT); + if (get_user(val, (int *)arg)) + return -EFAULT; if (val == DSP_BIND_QUERY) { val = dmabuf->channel->attribute | 0x3c00; val = attr2mask[val >> 8]; @@ -2476,7 +2484,7 @@ static int __init trident_probe(struct pci_dev *pci_dev, const struct pci_device /* edited by HMSEO for GT sound*/ } - pci_dev->driver_data = card; + pci_set_drvdata(pci_dev, card); pci_dev->dma_mask = TRIDENT_DMA_MASK; /* Enable Address Engine Interrupts */ @@ -2488,7 +2496,7 @@ static int __init trident_probe(struct pci_dev *pci_dev, const struct pci_device static void __exit trident_remove(struct pci_dev *pci_dev) { int i; - struct trident_card *card = pci_dev->driver_data; + struct trident_card *card = pci_get_drvdata(pci_dev); /* Kill interrupts, and SP/DIF */ trident_disable_loop_interrupts(card); @@ -2506,6 +2514,8 @@ static void __exit trident_remove(struct pci_dev *pci_dev) unregister_sound_dsp(card->dev_audio); kfree(card); + + pci_set_drvdata(pci_dev, NULL); } MODULE_AUTHOR("Alan Cox, Aaron Holtzman, Ollie Lho, Ching Ling Lee"); |