aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-08 00:07:55 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-08 00:07:55 -0700
commitdc5c72458480bb0b5e8abfa9a2968a9603c74dcf (patch)
tree22b946604505b3a0acc0781a0b3370da6b6ffc18 /sound
parentf7a4bc7ee10c8e39e80b3e84f227a5752b0092d9 (diff)
downloadhistory-dc5c72458480bb0b5e8abfa9a2968a9603c74dcf.tar.gz
Remove ESPIPE logic from drivers, letting the VFS layer handle it instead.
This cleans up and simplifies drivers, and also allows us future simplification in the VFS layer, since it removes knowledge about internal VFS layer handling of "f_pos".
Diffstat (limited to 'sound')
-rw-r--r--sound/oss/ad1889.c5
-rw-r--r--sound/oss/ali5455.c8
-rw-r--r--sound/oss/au1000.c8
-rw-r--r--sound/oss/cmpci.c8
-rw-r--r--sound/oss/cs4281/cs4281m.c14
-rw-r--r--sound/oss/cs46xx.c13
-rw-r--r--sound/oss/emu10k1/audio.c8
-rw-r--r--sound/oss/emu10k1/midi.c8
-rw-r--r--sound/oss/es1370.c18
-rw-r--r--sound/oss/es1371.c18
-rw-r--r--sound/oss/esssolo1.c16
-rw-r--r--sound/oss/forte.c8
-rw-r--r--sound/oss/hal2.c8
-rw-r--r--sound/oss/i810_audio.c8
-rw-r--r--sound/oss/ite8172.c8
-rw-r--r--sound/oss/maestro.c8
-rw-r--r--sound/oss/maestro3.c8
-rw-r--r--sound/oss/nec_vrc5477.c9
-rw-r--r--sound/oss/rme96xx.c8
-rw-r--r--sound/oss/sonicvibes.c16
-rw-r--r--sound/oss/swarm_cs4297a.c20
-rw-r--r--sound/oss/trident.c8
-rw-r--r--sound/oss/via82cxxx_audio.c14
-rw-r--r--sound/oss/ymfpci.c8
24 files changed, 56 insertions, 199 deletions
diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c
index 6e8be40abafe88..2423b1f2d59044 100644
--- a/sound/oss/ad1889.c
+++ b/sound/oss/ad1889.c
@@ -452,9 +452,6 @@ static ssize_t ad1889_write(struct file *file, const char __user *buffer, size_t
ssize_t ret = 0;
DECLARE_WAITQUEUE(wait, current);
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
down(&state->sem);
#if 0
if (dmabuf->mapped) {
@@ -764,7 +761,7 @@ static int ad1889_open(struct inode *inode, struct file *file)
ad1889_set_wav_rate(ad1889_dev, 44100);
ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE);
AD1889_WRITEW(ad1889_dev, AD_DSWADA, 0x0404); /* attenuation */
- return 0;
+ return nonseekable_open(inode, file);
}
static int ad1889_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/ali5455.c b/sound/oss/ali5455.c
index 0d1e9dce269e06..a7e2c3c0a5fd6c 100644
--- a/sound/oss/ali5455.c
+++ b/sound/oss/ali5455.c
@@ -1593,8 +1593,6 @@ static ssize_t ali_read(struct file *file, char __user *buffer,
#ifdef DEBUG2
printk("ali_audio: ali_read called, count = %d\n", count);
#endif
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (dmabuf->enable & DAC_RUNNING)
@@ -1734,8 +1732,6 @@ static ssize_t ali_write(struct file *file,
#ifdef DEBUG2
printk("ali_audio: ali_write called, count = %d\n", count);
#endif
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (dmabuf->enable & ADC_RUNNING)
@@ -2890,7 +2886,7 @@ found_virt:
state->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
outl(0x00000000, card->iobase + ALI_INTERRUPTCR);
outl(0x00000000, card->iobase + ALI_INTERRUPTSR);
- return 0;
+ return nonseekable_open(inode, file);
}
static int ali_release(struct inode *inode, struct file *file)
@@ -3047,7 +3043,7 @@ static int ali_open_mixdev(struct inode *inode, struct file *file)
if (card->ac97_codec[i] != NULL
&& card->ac97_codec[i]->dev_mixer == minor) {
file->private_data = card->ac97_codec[i];
- return 0;
+ return nonseekable_open(inode, file);
}
}
return -ENODEV;
diff --git a/sound/oss/au1000.c b/sound/oss/au1000.c
index 0ad69a2e77714f..ccfbad2dd02fbb 100644
--- a/sound/oss/au1000.c
+++ b/sound/oss/au1000.c
@@ -886,7 +886,7 @@ static loff_t au1000_llseek(struct file *file, loff_t offset, int origin)
static int au1000_open_mixdev(struct inode *inode, struct file *file)
{
file->private_data = &au1000_state;
- return 0;
+ return nonseekable_open(inode, file);
}
static int au1000_release_mixdev(struct inode *inode, struct file *file)
@@ -1120,8 +1120,6 @@ static ssize_t au1000_read(struct file *file, char *buffer,
unsigned long flags;
int cnt, usercnt, avail;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (db->mapped)
return -ENXIO;
if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -1204,8 +1202,6 @@ static ssize_t au1000_write(struct file *file, const char *buffer,
dbg("write: count=%d", count);
#endif
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (db->mapped)
return -ENXIO;
if (!access_ok(VERIFY_READ, buffer, count))
@@ -1907,7 +1903,7 @@ static int au1000_open(struct inode *inode, struct file *file)
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
init_MUTEX(&s->sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int au1000_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/cmpci.c b/sound/oss/cmpci.c
index c0da38bcdfc96c..386107f47bd432 100644
--- a/sound/oss/cmpci.c
+++ b/sound/oss/cmpci.c
@@ -1852,7 +1852,7 @@ static int cm_open_mixdev(struct inode *inode, struct file *file)
}
VALIDATE_STATE(s);
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int cm_release_mixdev(struct inode *inode, struct file *file)
@@ -1926,8 +1926,6 @@ static ssize_t cm_read(struct file *file, char __user *buffer, size_t count, lof
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
@@ -2028,8 +2026,6 @@ static ssize_t cm_write(struct file *file, const char __user *buffer, size_t cou
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac.mapped)
return -ENXIO;
if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0)))
@@ -2878,7 +2874,7 @@ static int cm_open(struct inode *inode, struct file *file)
set_fmt(s, fmtm, fmts);
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int cm_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/cs4281/cs4281m.c b/sound/oss/cs4281/cs4281m.c
index c2b496e3415fa3..a6f09cc63c46ae 100644
--- a/sound/oss/cs4281/cs4281m.c
+++ b/sound/oss/cs4281/cs4281m.c
@@ -2592,7 +2592,7 @@ static int cs4281_open_mixdev(struct inode *inode, struct file *file)
CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4,
printk(KERN_INFO "cs4281: cs4281_open_mixdev()- 0\n"));
- return 0;
+ return nonseekable_open(inode, file);
}
@@ -2874,8 +2874,6 @@ static ssize_t cs4281_read(struct file *file, char __user *buffer, size_t count,
printk(KERN_INFO "cs4281: cs4281_read()+ %Zu \n", count));
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s)))
@@ -2990,8 +2988,6 @@ static ssize_t cs4281_write(struct file *file, const char __user *buffer,
count));
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac.mapped)
return -ENXIO;
if (!s->dma_dac.ready && (ret = prog_dmabuf_dac(s)))
@@ -3725,7 +3721,7 @@ static int cs4281_open(struct inode *inode, struct file *file)
}
CS_DBGOUT(CS_FUNCTION | CS_OPEN, 2,
printk(KERN_INFO "cs4281: cs4281_open()- 0\n"));
- return 0;
+ return nonseekable_open(inode, file);
}
@@ -3842,8 +3838,6 @@ static ssize_t cs4281_midi_read(struct file *file, char __user *buffer,
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
ret = 0;
@@ -3890,8 +3884,6 @@ static ssize_t cs4281_midi_write(struct file *file, const char __user *buffer,
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
ret = 0;
@@ -4025,7 +4017,7 @@ static int cs4281_midi_open(struct inode *inode, struct file *file)
f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ |
FMODE_MIDI_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c
index 676f9881fc78d7..418f976c4554dc 100644
--- a/sound/oss/cs46xx.c
+++ b/sound/oss/cs46xx.c
@@ -1725,8 +1725,6 @@ static ssize_t cs_midi_read(struct file *file, char __user *buffer, size_t count
unsigned ptr;
int cnt;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
ret = 0;
@@ -1770,8 +1768,6 @@ static ssize_t cs_midi_write(struct file *file, const char __user *buffer, size_
unsigned ptr;
int cnt;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
ret = 0;
@@ -2106,8 +2102,6 @@ static ssize_t cs_read(struct file *file, char __user *buffer, size_t count, lof
return -ENODEV;
dmabuf = &state->dmabuf;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -2216,9 +2210,6 @@ static ssize_t cs_write(struct file *file, const char __user *buffer, size_t cou
return -EFAULT;
dmabuf = &state->dmabuf;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
down(&state->sem);
if (dmabuf->mapped)
{
@@ -3370,7 +3361,7 @@ static int cs_open(struct inode *inode, struct file *file)
return ret;
}
CS_DBGOUT(CS_OPEN | CS_FUNCTION, 2, printk("cs46xx: cs_open()- 0\n") );
- return 0;
+ return nonseekable_open(inode, file);
}
static int cs_release(struct inode *inode, struct file *file)
@@ -4104,7 +4095,7 @@ static int cs_open_mixdev(struct inode *inode, struct file *file)
CS_INC_USE_COUNT(&card->mixer_use_cnt);
CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4,
printk(KERN_INFO "cs46xx: cs_open_mixdev()- 0\n"));
- return 0;
+ return nonseekable_open(inode, file);
}
static int cs_release_mixdev(struct inode *inode, struct file *file)
diff --git a/sound/oss/emu10k1/audio.c b/sound/oss/emu10k1/audio.c
index 1aac3655d68eba..9cf30ab2ff4293 100644
--- a/sound/oss/emu10k1/audio.c
+++ b/sound/oss/emu10k1/audio.c
@@ -59,9 +59,6 @@ static ssize_t emu10k1_audio_read(struct file *file, char __user *buffer, size_t
DPD(3, "emu10k1_audio_read(), buffer=%p, count=%d\n", buffer, (u32) count);
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
@@ -146,9 +143,6 @@ static ssize_t emu10k1_audio_write(struct file *file, const char __user *buffer,
DPD(3, "emu10k1_audio_write(), buffer=%p, count=%d\n", buffer, (u32) count);
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
@@ -1249,7 +1243,7 @@ match:
file->private_data = (void *) wave_dev;
- return 0;
+ return nonseekable_open(inode, file);
}
static int emu10k1_audio_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c
index 0f220081e878ed..ec2424db43cb18 100644
--- a/sound/oss/emu10k1/midi.c
+++ b/sound/oss/emu10k1/midi.c
@@ -185,7 +185,7 @@ match:
up(&card->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int emu10k1_midi_release(struct inode *inode, struct file *file)
@@ -253,9 +253,6 @@ static ssize_t emu10k1_midi_read(struct file *file, char __user *buffer, size_t
DPD(4, "emu10k1_midi_read(), count %#x\n", (u32) count);
- if (pos != &file->f_pos)
- return -ESPIPE;
-
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
@@ -328,9 +325,6 @@ static ssize_t emu10k1_midi_write(struct file *file, const char __user *buffer,
DPD(4, "emu10k1_midi_write(), count=%#x\n", (u32) count);
- if (pos != &file->f_pos)
- return -ESPIPE;
-
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
diff --git a/sound/oss/es1370.c b/sound/oss/es1370.c
index 68189853ac11bb..57f9bc147699f6 100644
--- a/sound/oss/es1370.c
+++ b/sound/oss/es1370.c
@@ -1037,7 +1037,7 @@ static int es1370_open_mixdev(struct inode *inode, struct file *file)
}
VALIDATE_STATE(s);
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1370_release_mixdev(struct inode *inode, struct file *file)
@@ -1147,8 +1147,6 @@ static ssize_t es1370_read(struct file *file, char __user *buffer, size_t count,
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -1225,8 +1223,6 @@ static ssize_t es1370_write(struct file *file, const char __user *buffer, size_t
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac2.mapped)
return -ENXIO;
if (!access_ok(VERIFY_READ, buffer, count))
@@ -1789,7 +1785,7 @@ static int es1370_open(struct inode *inode, struct file *file)
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
init_MUTEX(&s->sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1370_release(struct inode *inode, struct file *file)
@@ -1841,8 +1837,6 @@ static ssize_t es1370_write_dac(struct file *file, const char __user *buffer, si
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac1.mapped)
return -ENXIO;
if (!s->dma_dac1.ready && (ret = prog_dmabuf_dac1(s)))
@@ -2222,7 +2216,7 @@ static int es1370_open_dac(struct inode *inode, struct file *file)
spin_unlock_irqrestore(&s->lock, flags);
s->open_mode |= FMODE_DAC;
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1370_release_dac(struct inode *inode, struct file *file)
@@ -2265,8 +2259,6 @@ static ssize_t es1370_midi_read(struct file *file, char __user *buffer, size_t c
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
if (count == 0)
@@ -2328,8 +2320,6 @@ static ssize_t es1370_midi_write(struct file *file, const char __user *buffer, s
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
if (count == 0)
@@ -2464,7 +2454,7 @@ static int es1370_midi_open(struct inode *inode, struct file *file)
spin_unlock_irqrestore(&s->lock, flags);
s->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1370_midi_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c
index 7d1a108dde35c9..d6b59fbe5ad3c4 100644
--- a/sound/oss/es1371.c
+++ b/sound/oss/es1371.c
@@ -1223,7 +1223,7 @@ static int es1371_open_mixdev(struct inode *inode, struct file *file)
}
VALIDATE_STATE(s);
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1371_release_mixdev(struct inode *inode, struct file *file)
@@ -1334,8 +1334,6 @@ static ssize_t es1371_read(struct file *file, char __user *buffer, size_t count,
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -1413,8 +1411,6 @@ static ssize_t es1371_write(struct file *file, const char __user *buffer, size_t
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac2.mapped)
return -ENXIO;
if (!access_ok(VERIFY_READ, buffer, count))
@@ -1978,7 +1974,7 @@ static int es1371_open(struct inode *inode, struct file *file)
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
init_MUTEX(&s->sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1371_release(struct inode *inode, struct file *file)
@@ -2029,8 +2025,6 @@ static ssize_t es1371_write_dac(struct file *file, const char __user *buffer, si
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac1.mapped)
return -ENXIO;
if (!s->dma_dac1.ready && (ret = prog_dmabuf_dac1(s)))
@@ -2400,7 +2394,7 @@ static int es1371_open_dac(struct inode *inode, struct file *file)
spin_unlock_irqrestore(&s->lock, flags);
s->open_mode |= FMODE_DAC;
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1371_release_dac(struct inode *inode, struct file *file)
@@ -2443,8 +2437,6 @@ static ssize_t es1371_midi_read(struct file *file, char __user *buffer, size_t c
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
if (count == 0)
@@ -2506,8 +2498,6 @@ static ssize_t es1371_midi_write(struct file *file, const char __user *buffer, s
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
if (count == 0)
@@ -2642,7 +2632,7 @@ static int es1371_midi_open(struct inode *inode, struct file *file)
spin_unlock_irqrestore(&s->lock, flags);
s->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1371_midi_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c
index b5096b5a440134..3002cbe68bf5fd 100644
--- a/sound/oss/esssolo1.c
+++ b/sound/oss/esssolo1.c
@@ -933,7 +933,7 @@ static int solo1_open_mixdev(struct inode *inode, struct file *file)
return -ENODEV;
VALIDATE_STATE(s);
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int solo1_release_mixdev(struct inode *inode, struct file *file)
@@ -1010,8 +1010,6 @@ static ssize_t solo1_read(struct file *file, char __user *buffer, size_t count,
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s)))
@@ -1106,8 +1104,6 @@ static ssize_t solo1_write(struct file *file, const char __user *buffer, size_t
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac.mapped)
return -ENXIO;
if (!s->dma_dac.ready && (ret = prog_dmabuf_dac(s)))
@@ -1647,7 +1643,7 @@ static int solo1_open(struct inode *inode, struct file *file)
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
prog_codec(s);
- return 0;
+ return nonseekable_open(inode, file);
}
static /*const*/ struct file_operations solo1_audio_fops = {
@@ -1740,8 +1736,6 @@ static ssize_t solo1_midi_read(struct file *file, char __user *buffer, size_t co
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
if (count == 0)
@@ -1803,8 +1797,6 @@ static ssize_t solo1_midi_write(struct file *file, const char __user *buffer, si
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
if (count == 0)
@@ -1951,7 +1943,7 @@ static int solo1_midi_open(struct inode *inode, struct file *file)
spin_unlock_irqrestore(&s->lock, flags);
s->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int solo1_midi_release(struct inode *inode, struct file *file)
@@ -2161,7 +2153,7 @@ static int solo1_dmfm_open(struct inode *inode, struct file *file)
outb(1, s->sbbase+3); /* enable OPL3 */
s->open_mode |= FMODE_DMFM;
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int solo1_dmfm_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/forte.c b/sound/oss/forte.c
index 0d91bbf832f2f0..ac4badae5f5e08 100644
--- a/sound/oss/forte.c
+++ b/sound/oss/forte.c
@@ -1265,7 +1265,7 @@ forte_dsp_open (struct inode *inode, struct file *file)
if (file->f_mode & FMODE_READ)
forte_channel_init (forte, &forte->rec);
- return 0;
+ return nonseekable_open(inode, file);
}
@@ -1438,9 +1438,6 @@ forte_dsp_write (struct file *file, const char __user *buffer, size_t bytes,
unsigned int i = bytes, sz = 0;
unsigned long flags;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (!access_ok (VERIFY_READ, buffer, bytes))
return -EFAULT;
@@ -1546,9 +1543,6 @@ forte_dsp_read (struct file *file, char __user *buffer, size_t bytes,
unsigned int i = bytes, sz;
unsigned long flags;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (!access_ok (VERIFY_WRITE, buffer, bytes))
return -EFAULT;
diff --git a/sound/oss/hal2.c b/sound/oss/hal2.c
index 1f49d04242f372..afe97c4ce069a5 100644
--- a/sound/oss/hal2.c
+++ b/sound/oss/hal2.c
@@ -959,7 +959,7 @@ static int hal2_open_mixdev(struct inode *inode, struct file *file)
if (hal2) {
file->private_data = hal2;
- return 0;
+ return nonseekable_open(inode, file);
}
return -ENODEV;
}
@@ -1178,8 +1178,6 @@ static ssize_t hal2_read(struct file *file, char *buffer,
if (!count)
return 0;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (down_interruptible(&adc->sem))
return -EINTR;
if (file->f_flags & O_NONBLOCK) {
@@ -1234,8 +1232,6 @@ static ssize_t hal2_write(struct file *file, const char *buffer,
if (!count)
return 0;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (down_interruptible(&dac->sem))
return -EINTR;
if (file->f_flags & O_NONBLOCK) {
@@ -1350,7 +1346,7 @@ static int hal2_open(struct inode *inode, struct file *file)
dac->usecount++;
}
- return 0;
+ return nonseekable_open(inode, file);
}
static int hal2_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
index 3de038a6bbc46f..918c2a23b679ab 100644
--- a/sound/oss/i810_audio.c
+++ b/sound/oss/i810_audio.c
@@ -1434,8 +1434,6 @@ static ssize_t i810_read(struct file *file, char __user *buffer, size_t count, l
printk("i810_audio: i810_read called, count = %d\n", count);
#endif
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (dmabuf->enable & DAC_RUNNING)
@@ -1574,8 +1572,6 @@ static ssize_t i810_write(struct file *file, const char __user *buffer, size_t c
printk("i810_audio: i810_write called, count = %d\n", count);
#endif
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (dmabuf->enable & ADC_RUNNING)
@@ -2518,7 +2514,7 @@ found_virt:
state->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
- return 0;
+ return nonseekable_open(inode, file);
}
static int i810_release(struct inode *inode, struct file *file)
@@ -2685,7 +2681,7 @@ static int i810_open_mixdev(struct inode *inode, struct file *file)
if (card->ac97_codec[i] != NULL &&
card->ac97_codec[i]->dev_mixer == minor) {
file->private_data = card->ac97_codec[i];
- return 0;
+ return nonseekable_open(inode, file);
}
}
return -ENODEV;
diff --git a/sound/oss/ite8172.c b/sound/oss/ite8172.c
index f62efd8a4aa633..16e7d01efec2a2 100644
--- a/sound/oss/ite8172.c
+++ b/sound/oss/ite8172.c
@@ -878,7 +878,7 @@ static int it8172_open_mixdev(struct inode *inode, struct file *file)
break;
}
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int it8172_release_mixdev(struct inode *inode, struct file *file)
@@ -1093,8 +1093,6 @@ static ssize_t it8172_read(struct file *file, char *buffer,
unsigned long flags;
int cnt, remainder, avail;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (db->mapped)
return -ENXIO;
if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -1176,8 +1174,6 @@ static ssize_t it8172_write(struct file *file, const char *buffer,
unsigned long flags;
int cnt, remainder, avail;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (db->mapped)
return -ENXIO;
if (!access_ok(VERIFY_READ, buffer, count))
@@ -1843,7 +1839,7 @@ static int it8172_open(struct inode *inode, struct file *file)
s->open_mode |= (file->f_mode & (FMODE_READ | FMODE_WRITE));
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int it8172_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/maestro.c b/sound/oss/maestro.c
index 4a670f4e4d3ae1..66456dbb272727 100644
--- a/sound/oss/maestro.c
+++ b/sound/oss/maestro.c
@@ -2158,7 +2158,7 @@ static int ess_open_mixdev(struct inode *inode, struct file *file)
if (!card)
return -ENODEV;
file->private_data = card;
- return 0;
+ return nonseekable_open(inode, file);
}
static int ess_release_mixdev(struct inode *inode, struct file *file)
@@ -2274,8 +2274,6 @@ ess_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
unsigned char *combbuf = NULL;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
@@ -2372,8 +2370,6 @@ ess_write(struct file *file, const char __user *buffer, size_t count, loff_t *pp
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac.mapped)
return -ENXIO;
if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0)))
@@ -3082,7 +3078,7 @@ ess_open(struct inode *inode, struct file *file)
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int
diff --git a/sound/oss/maestro3.c b/sound/oss/maestro3.c
index 2830f7f1e1d911..c27e88f476f223 100644
--- a/sound/oss/maestro3.c
+++ b/sound/oss/maestro3.c
@@ -1333,8 +1333,6 @@ static ssize_t m3_read(struct file *file, char __user *buffer, size_t count, lof
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
@@ -1414,8 +1412,6 @@ static ssize_t m3_write(struct file *file, const char __user *buffer, size_t cou
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac.mapped)
return -ENXIO;
if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0)))
@@ -2051,7 +2047,7 @@ static int m3_open(struct inode *inode, struct file *file)
up(&s->open_sem);
spin_unlock_irqrestore(&c->lock, flags);
- return 0;
+ return nonseekable_open(inode, file);
}
static int m3_release(struct inode *inode, struct file *file)
@@ -2165,7 +2161,7 @@ static int m3_open_mixdev(struct inode *inode, struct file *file)
file->private_data = card->ac97;
- return 0;
+ return nonseekable_open(inode, file);
}
static int m3_release_mixdev(struct inode *inode, struct file *file)
diff --git a/sound/oss/nec_vrc5477.c b/sound/oss/nec_vrc5477.c
index 7ac7126664a7cf..b40611b422a067 100644
--- a/sound/oss/nec_vrc5477.c
+++ b/sound/oss/nec_vrc5477.c
@@ -868,7 +868,7 @@ static int vrc5477_ac97_open_mixdev(struct inode *inode, struct file *file)
break;
}
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int vrc5477_ac97_release_mixdev(struct inode *inode, struct file *file)
@@ -1043,8 +1043,6 @@ vrc5477_ac97_read(struct file *file,
int copyCount;
size_t avail;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
@@ -1229,8 +1227,6 @@ static ssize_t vrc5477_ac97_write(struct file *file, const char *buffer,
unsigned long flags;
int copyCount, avail;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
ret = 0;
@@ -1574,7 +1570,8 @@ static int vrc5477_ac97_open(struct inode *inode, struct file *file)
struct list_head *list;
struct vrc5477_ac97_state *s;
int ret=0;
-
+
+ nonseekable_open(inode, file);
for (list = devs.next; ; list = list->next) {
if (list == &devs)
return -ENODEV;
diff --git a/sound/oss/rme96xx.c b/sound/oss/rme96xx.c
index 404ba23b159220..3df045dd55f964 100644
--- a/sound/oss/rme96xx.c
+++ b/sound/oss/rme96xx.c
@@ -1454,6 +1454,7 @@ static int rme96xx_open(struct inode *in, struct file *f)
DBG(printk("device num %d open\n",devnum));
+ nonseekable_open(in, f);
for (list = devs.next; ; list = list->next) {
if (list == &devs)
return -ENODEV;
@@ -1543,9 +1544,6 @@ static ssize_t rme96xx_write(struct file *file, const char __user *buffer, size_
if(dma == NULL || (dma->s) == NULL)
return -ENXIO;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (dma->mmapped || !dma->opened)
return -ENXIO;
@@ -1611,9 +1609,6 @@ static ssize_t rme96xx_read(struct file *file, char __user *buffer, size_t count
if(dma == NULL || (dma->s) == NULL)
return -ENXIO;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (dma->mmapped || !dma->opened)
return -ENXIO;
@@ -1775,6 +1770,7 @@ static int rme96xx_mixer_open(struct inode *inode, struct file *file)
COMM ("mixer open");
+ nonseekable_open(inode, file);
for (list = devs.next; ; list = list->next) {
if (list == &devs)
return -ENODEV;
diff --git a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c
index e231cf0a7e3df4..8bb6deaad0358f 100644
--- a/sound/oss/sonicvibes.c
+++ b/sound/oss/sonicvibes.c
@@ -1252,7 +1252,7 @@ static int sv_open_mixdev(struct inode *inode, struct file *file)
}
VALIDATE_STATE(s);
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int sv_release_mixdev(struct inode *inode, struct file *file)
@@ -1325,8 +1325,6 @@ static ssize_t sv_read(struct file *file, char __user *buffer, size_t count, lof
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
@@ -1410,8 +1408,6 @@ static ssize_t sv_write(struct file *file, const char __user *buffer, size_t cou
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac.mapped)
return -ENXIO;
if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0)))
@@ -1954,7 +1950,7 @@ static int sv_open(struct inode *inode, struct file *file)
set_fmt(s, fmtm, fmts);
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int sv_release(struct inode *inode, struct file *file)
@@ -2005,8 +2001,6 @@ static ssize_t sv_midi_read(struct file *file, char __user *buffer, size_t count
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
if (count == 0)
@@ -2068,8 +2062,6 @@ static ssize_t sv_midi_write(struct file *file, const char __user *buffer, size_
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
if (count == 0)
@@ -2212,7 +2204,7 @@ static int sv_midi_open(struct inode *inode, struct file *file)
spin_unlock_irqrestore(&s->lock, flags);
s->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int sv_midi_release(struct inode *inode, struct file *file)
@@ -2414,7 +2406,7 @@ static int sv_dmfm_open(struct inode *inode, struct file *file)
outb(1, s->iosynth+3); /* enable OPL3 */
s->open_mode |= FMODE_DMFM;
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int sv_dmfm_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/swarm_cs4297a.c b/sound/oss/swarm_cs4297a.c
index 0f58fa4944c072..4846dc2cb12138 100644
--- a/sound/oss/swarm_cs4297a.c
+++ b/sound/oss/swarm_cs4297a.c
@@ -1526,14 +1526,6 @@ static int mixer_ioctl(struct cs4297a_state *s, unsigned int cmd,
// ---------------------------------------------------------------------
-static loff_t cs4297a_llseek(struct file *file, loff_t offset, int origin)
-{
- return -ESPIPE;
-}
-
-
-// ---------------------------------------------------------------------
-
static int cs4297a_open_mixdev(struct inode *inode, struct file *file)
{
int minor = iminor(inode);
@@ -1561,7 +1553,7 @@ static int cs4297a_open_mixdev(struct inode *inode, struct file *file)
CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4,
printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()- 0\n"));
- return 0;
+ return nonseekable_open(inode, file);
}
@@ -1588,7 +1580,7 @@ static int cs4297a_ioctl_mixdev(struct inode *inode, struct file *file,
// ******************************************************************************************
static /*const */ struct file_operations cs4297a_mixer_fops = {
.owner = THIS_MODULE,
- .llseek = cs4297a_llseek,
+ .llseek = no_llseek,
.ioctl = cs4297a_ioctl_mixdev,
.open = cs4297a_open_mixdev,
.release = cs4297a_release_mixdev,
@@ -1658,8 +1650,6 @@ static ssize_t cs4297a_read(struct file *file, char *buffer, size_t count,
printk(KERN_INFO "cs4297a: cs4297a_read()+ %d \n", count));
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s)))
@@ -1784,8 +1774,6 @@ static ssize_t cs4297a_write(struct file *file, const char *buffer,
count));
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac.mapped)
return -ENXIO;
if (!s->dma_dac.ready && (ret = prog_dmabuf_dac(s)))
@@ -2494,7 +2482,7 @@ static int cs4297a_open(struct inode *inode, struct file *file)
}
CS_DBGOUT(CS_FUNCTION | CS_OPEN, 2,
printk(KERN_INFO "cs4297a: cs4297a_open()- 0\n"));
- return 0;
+ return nonseekable_open(inode, file);
}
@@ -2503,7 +2491,7 @@ static int cs4297a_open(struct inode *inode, struct file *file)
// ******************************************************************************************
static /*const */ struct file_operations cs4297a_audio_fops = {
.owner = THIS_MODULE,
- .llseek = cs4297a_llseek,
+ .llseek = no_llseek,
.read = cs4297a_read,
.write = cs4297a_write,
.poll = cs4297a_poll,
diff --git a/sound/oss/trident.c b/sound/oss/trident.c
index ed04f4007c2d0f..1beb4e9ffe89ab 100644
--- a/sound/oss/trident.c
+++ b/sound/oss/trident.c
@@ -1874,8 +1874,6 @@ trident_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos
pr_debug("trident: trident_read called, count = %d\n", count);
VALIDATE_STATE(state);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
@@ -1992,8 +1990,6 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t
pr_debug("trident: trident_write called, count = %d\n", count);
VALIDATE_STATE(state);
- if (ppos != &file->f_pos)
- return -ESPIPE;
/*
* Guard against an mmap or ioctl while writing
@@ -2823,7 +2819,7 @@ trident_open(struct inode *inode, struct file *file)
pr_debug("trident: open virtual channel %d, hard channel %d\n",
state->virt, dmabuf->channel->num);
- return 0;
+ return nonseekable_open(inode, file);
}
static int
@@ -4079,7 +4075,7 @@ trident_open_mixdev(struct inode *inode, struct file *file)
match:
file->private_data = card->ac97_codec[i];
- return 0;
+ return nonseekable_open(inode, file);
}
static int
diff --git a/sound/oss/via82cxxx_audio.c b/sound/oss/via82cxxx_audio.c
index 40f3f2e2ed918d..dc1c25663b10a4 100644
--- a/sound/oss/via82cxxx_audio.c
+++ b/sound/oss/via82cxxx_audio.c
@@ -1580,7 +1580,7 @@ match:
file->private_data = card->ac97;
DPRINTK ("EXIT, returning 0\n");
- return 0;
+ return nonseekable_open(inode, file);
}
static int via_mixer_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
@@ -2401,11 +2401,6 @@ static ssize_t via_dsp_read(struct file *file, char __user *buffer, size_t count
card = file->private_data;
assert (card != NULL);
- if (ppos != &file->f_pos) {
- DPRINTK ("EXIT, returning -ESPIPE\n");
- return -ESPIPE;
- }
-
rc = via_syscall_down (card, nonblock);
if (rc) goto out;
@@ -2589,11 +2584,6 @@ static ssize_t via_dsp_write(struct file *file, const char __user *buffer, size_
card = file->private_data;
assert (card != NULL);
- if (ppos != &file->f_pos) {
- DPRINTK ("EXIT, returning -ESPIPE\n");
- return -ESPIPE;
- }
-
rc = via_syscall_down (card, nonblock);
if (rc) goto out;
@@ -3345,7 +3335,7 @@ match:
}
DPRINTK ("EXIT, returning 0\n");
- return 0;
+ return nonseekable_open(inode, file);
}
diff --git a/sound/oss/ymfpci.c b/sound/oss/ymfpci.c
index afa2876b62603a..13bcc7621cf8d1 100644
--- a/sound/oss/ymfpci.c
+++ b/sound/oss/ymfpci.c
@@ -1231,8 +1231,6 @@ ymf_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
unsigned int swptr;
int cnt; /* This many to go in this revolution */
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (!dmabuf->ready && (ret = prog_dmabuf(state, 1)))
@@ -1350,8 +1348,6 @@ ymf_write(struct file *file, const char __user *buffer, size_t count, loff_t *pp
YMFDBGW("ymf_write: count %d\n", count);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (!dmabuf->ready && (ret = prog_dmabuf(state, 0)))
@@ -1965,7 +1961,7 @@ static int ymf_open(struct inode *inode, struct file *file)
#endif
up(&unit->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
out_nodma:
/*
@@ -2043,7 +2039,7 @@ static int ymf_open_mixdev(struct inode *inode, struct file *file)
match:
file->private_data = unit->ac97_codec[i];
- return 0;
+ return nonseekable_open(inode, file);
}
static int ymf_ioctl_mixdev(struct inode *inode, struct file *file,