aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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 /drivers
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 'drivers')
-rw-r--r--drivers/bluetooth/hci_vhci.c2
-rw-r--r--drivers/char/dtlk.c6
-rw-r--r--drivers/char/ftape/zftape/zftape-init.c1
-rw-r--r--drivers/char/ipmi/ipmi_watchdog.c10
-rw-r--r--drivers/char/scx200_gpio.c8
-rw-r--r--drivers/char/tipar.c5
-rw-r--r--drivers/char/watchdog/acquirewdt.c6
-rw-r--r--drivers/char/watchdog/advantechwdt.c6
-rw-r--r--drivers/char/watchdog/alim1535_wdt.c6
-rw-r--r--drivers/char/watchdog/alim7101_wdt.c6
-rw-r--r--drivers/char/watchdog/eurotechwdt.c6
-rw-r--r--drivers/char/watchdog/i8xx_tco.c6
-rw-r--r--drivers/char/watchdog/ib700wdt.c6
-rw-r--r--drivers/char/watchdog/indydog.c6
-rw-r--r--drivers/char/watchdog/ixp2000_wdt.c6
-rw-r--r--drivers/char/watchdog/ixp4xx_wdt.c6
-rw-r--r--drivers/char/watchdog/machzwd.c6
-rw-r--r--drivers/char/watchdog/mixcomwd.c6
-rw-r--r--drivers/char/watchdog/pcwd.c12
-rw-r--r--drivers/char/watchdog/pcwd_pci.c12
-rw-r--r--drivers/char/watchdog/pcwd_usb.c12
-rw-r--r--drivers/char/watchdog/sa1100_wdt.c5
-rw-r--r--drivers/char/watchdog/sbc60xxwdt.c6
-rw-r--r--drivers/char/watchdog/sc1200wdt.c5
-rw-r--r--drivers/char/watchdog/sc520_wdt.c6
-rw-r--r--drivers/char/watchdog/scx200_wdt.c5
-rw-r--r--drivers/char/watchdog/shwdt.c6
-rw-r--r--drivers/char/watchdog/softdog.c6
-rw-r--r--drivers/char/watchdog/w83627hf_wdt.c6
-rw-r--r--drivers/char/watchdog/w83877f_wdt.c6
-rw-r--r--drivers/char/watchdog/wafer5823wdt.c6
-rw-r--r--drivers/char/watchdog/wdt.c12
-rw-r--r--drivers/char/watchdog/wdt285.c5
-rw-r--r--drivers/char/watchdog/wdt977.c6
-rw-r--r--drivers/char/watchdog/wdt_pci.c12
-rw-r--r--drivers/isdn/capi/capi.c8
-rw-r--r--drivers/isdn/hardware/eicon/divamnt.c5
-rw-r--r--drivers/isdn/hardware/eicon/divasproc.c4
-rw-r--r--drivers/isdn/hysdn/hysdn_procconf.c7
-rw-r--r--drivers/isdn/hysdn/hysdn_proclog.c5
-rw-r--r--drivers/isdn/i4l/isdn_common.c7
-rw-r--r--drivers/s390/char/tape_char.c18
-rw-r--r--drivers/sbus/char/cpwatchdog.c5
-rw-r--r--drivers/sbus/char/riowatchdog.c4
-rw-r--r--drivers/scsi/osst.c13
-rw-r--r--drivers/usb/class/audio.c8
-rw-r--r--drivers/usb/class/usb-midi.c8
-rw-r--r--drivers/usb/media/dabusb.c2
-rw-r--r--drivers/usb/misc/auerswald.c2
-rw-r--r--drivers/usb/misc/legousbtower.c1
-rw-r--r--drivers/usb/misc/tiglusb.c2
51 files changed, 60 insertions, 271 deletions
diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 9faa8a08a83626..d1df4adff1a995 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -302,7 +302,7 @@ static int hci_vhci_chr_open(struct inode *inode, struct file * file)
}
file->private_data = hci_vhci;
- return 0;
+ return nonseekable_open(inode, file);
}
static int hci_vhci_chr_close(struct inode *inode, struct file *file)
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
index 22c6a921e6bb31..e8f15f46eca43b 100644
--- a/drivers/char/dtlk.c
+++ b/drivers/char/dtlk.c
@@ -176,10 +176,6 @@ static ssize_t dtlk_write(struct file *file, const char __user *buf,
}
#endif
- /* Can't seek (pwrite) on the DoubleTalk. */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (iminor(file->f_dentry->d_inode) != DTLK_MINOR)
return -EINVAL;
@@ -304,7 +300,7 @@ static int dtlk_open(struct inode *inode, struct file *file)
case DTLK_MINOR:
if (dtlk_busy)
return -EBUSY;
- return 0;
+ return nonseekable_open(inode, file);
default:
return -ENXIO;
diff --git a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c
index 95666a2ebe13ed..eefd94a6d04c8c 100644
--- a/drivers/char/ftape/zftape/zftape-init.c
+++ b/drivers/char/ftape/zftape/zftape-init.c
@@ -113,6 +113,7 @@ static int zft_open(struct inode *ino, struct file *filep)
int result;
TRACE_FUN(ft_t_flow);
+ nonseekable_open(ino, filep);
TRACE(ft_t_flow, "called for minor %d", iminor(ino));
if ( test_and_set_bit(0,&busy_flag) ) {
TRACE_ABORT(-EBUSY, ft_t_warn, "failed: already busy");
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
index 59cf9b4083590d..fb84924901efa0 100644
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -598,10 +598,6 @@ static ssize_t ipmi_write(struct file *file,
{
int rv;
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (len) {
rv = ipmi_heartbeat();
if (rv)
@@ -619,10 +615,6 @@ static ssize_t ipmi_read(struct file *file,
int rv = 0;
wait_queue_t wait;
- /* Can't seek (pread) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count <= 0)
return 0;
@@ -678,7 +670,7 @@ static int ipmi_open(struct inode *ino, struct file *filep)
/* Don't start the timer now, let it start on the
first heartbeat. */
ipmi_start_timer_on_heartbeat = 1;
- return(0);
+ return nonseekable_open(ino, filep);
default:
return (-ENODEV);
diff --git a/drivers/char/scx200_gpio.c b/drivers/char/scx200_gpio.c
index e937346e162b40..70b5e94b5df942 100644
--- a/drivers/char/scx200_gpio.c
+++ b/drivers/char/scx200_gpio.c
@@ -32,9 +32,6 @@ static ssize_t scx200_gpio_write(struct file *file, const char __user *data,
unsigned m = iminor(file->f_dentry->d_inode);
size_t i;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
for (i = 0; i < len; ++i) {
char c;
if (get_user(c, data+i))
@@ -83,9 +80,6 @@ static ssize_t scx200_gpio_read(struct file *file, char __user *buf,
unsigned m = iminor(file->f_dentry->d_inode);
int value;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
value = scx200_gpio_get(m);
if (put_user(value ? '1' : '0', buf))
return -EFAULT;
@@ -98,7 +92,7 @@ static int scx200_gpio_open(struct inode *inode, struct file *file)
unsigned m = iminor(inode);
if (m > 63)
return -EINVAL;
- return 0;
+ return nonseekable_open(inode, file);
}
static int scx200_gpio_release(struct inode *inode, struct file *file)
diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c
index 5f821fe0b8a78b..48d7a7cc0c2bbe 100644
--- a/drivers/char/tipar.c
+++ b/drivers/char/tipar.c
@@ -262,7 +262,7 @@ tipar_open(struct inode *inode, struct file *file)
init_ti_parallel(minor);
parport_release(table[minor].dev);
- return 0;
+ return nonseekable_open(inode, file);
}
static int
@@ -316,9 +316,6 @@ tipar_read(struct file *file, char __user *buf, size_t count, loff_t * ppos)
if (count == 0)
return 0;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
parport_claim_or_block(table[minor].dev);
while (n < count) {
diff --git a/drivers/char/watchdog/acquirewdt.c b/drivers/char/watchdog/acquirewdt.c
index 2febb25a4feabc..8f302121741bc9 100644
--- a/drivers/char/watchdog/acquirewdt.c
+++ b/drivers/char/watchdog/acquirewdt.c
@@ -113,10 +113,6 @@ static void acq_stop(void)
static ssize_t acq_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if(count) {
if (!nowayout) {
@@ -206,7 +202,7 @@ static int acq_open(struct inode *inode, struct file *file)
/* Activate */
acq_keepalive();
- return 0;
+ return nonseekable_open(inode, file);
}
static int acq_close(struct inode *inode, struct file *file)
diff --git a/drivers/char/watchdog/advantechwdt.c b/drivers/char/watchdog/advantechwdt.c
index 4090794ee1414a..ea73c8379bdda6 100644
--- a/drivers/char/watchdog/advantechwdt.c
+++ b/drivers/char/watchdog/advantechwdt.c
@@ -102,10 +102,6 @@ advwdt_disable(void)
static ssize_t
advwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
@@ -200,7 +196,7 @@ advwdt_open(struct inode *inode, struct file *file)
*/
advwdt_ping();
- return 0;
+ return nonseekable_open(inode, file);
}
static int
diff --git a/drivers/char/watchdog/alim1535_wdt.c b/drivers/char/watchdog/alim1535_wdt.c
index f093a698f96f94..35dcbf8be7d1c9 100644
--- a/drivers/char/watchdog/alim1535_wdt.c
+++ b/drivers/char/watchdog/alim1535_wdt.c
@@ -141,10 +141,6 @@ static int ali_settimer(int t)
static ssize_t ali_write(struct file *file, const char __user *data,
size_t len, loff_t * ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if (len) {
if (!nowayout) {
@@ -266,7 +262,7 @@ static int ali_open(struct inode *inode, struct file *file)
/* Activate */
ali_start();
- return 0;
+ return nonseekable_open(inode, file);
}
/*
diff --git a/drivers/char/watchdog/alim7101_wdt.c b/drivers/char/watchdog/alim7101_wdt.c
index c137cd3bc6b314..5ff6a6e4a4f7df 100644
--- a/drivers/char/watchdog/alim7101_wdt.c
+++ b/drivers/char/watchdog/alim7101_wdt.c
@@ -150,10 +150,6 @@ static void wdt_keepalive(void)
static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
{
- /* We can't seek */
- if(ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if(count) {
if (!nowayout) {
@@ -185,7 +181,7 @@ static int fop_open(struct inode * inode, struct file * file)
return -EBUSY;
/* Good, fire up the show */
wdt_startup();
- return 0;
+ return nonseekable_open(inode, file);
}
static int fop_close(struct inode * inode, struct file * file)
diff --git a/drivers/char/watchdog/eurotechwdt.c b/drivers/char/watchdog/eurotechwdt.c
index 01df6566b70268..d10e554a14d650 100644
--- a/drivers/char/watchdog/eurotechwdt.c
+++ b/drivers/char/watchdog/eurotechwdt.c
@@ -199,10 +199,6 @@ static void eurwdt_ping(void)
static ssize_t eurwdt_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
@@ -310,7 +306,7 @@ static int eurwdt_open(struct inode *inode, struct file *file)
eurwdt_timeout = WDT_TIMEOUT; /* initial timeout */
/* Activate the WDT */
eurwdt_activate_timer();
- return 0;
+ return nonseekable_open(inode, file);
}
/**
diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c
index 8a63f7fb75d195..5fc054700c4dfb 100644
--- a/drivers/char/watchdog/i8xx_tco.c
+++ b/drivers/char/watchdog/i8xx_tco.c
@@ -193,7 +193,7 @@ static int i8xx_tco_open (struct inode *inode, struct file *file)
*/
tco_timer_keepalive ();
tco_timer_start ();
- return 0;
+ return nonseekable_open(inode, file);
}
static int i8xx_tco_release (struct inode *inode, struct file *file)
@@ -215,10 +215,6 @@ static int i8xx_tco_release (struct inode *inode, struct file *file)
static ssize_t i8xx_tco_write (struct file *file, const char __user *data,
size_t len, loff_t * ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if (len) {
if (!nowayout) {
diff --git a/drivers/char/watchdog/ib700wdt.c b/drivers/char/watchdog/ib700wdt.c
index 0d48439c972962..cd6467eb425d2b 100644
--- a/drivers/char/watchdog/ib700wdt.c
+++ b/drivers/char/watchdog/ib700wdt.c
@@ -141,10 +141,6 @@ ibwdt_ping(void)
static ssize_t
ibwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
@@ -228,7 +224,7 @@ ibwdt_open(struct inode *inode, struct file *file)
/* Activate */
ibwdt_ping();
spin_unlock(&ibwdt_lock);
- return 0;
+ return nonseekable_open(inode, file);
}
static int
diff --git a/drivers/char/watchdog/indydog.c b/drivers/char/watchdog/indydog.c
index 23fc36473f3418..4e9093b4af8d82 100644
--- a/drivers/char/watchdog/indydog.c
+++ b/drivers/char/watchdog/indydog.c
@@ -81,7 +81,7 @@ static int indydog_open(struct inode *inode, struct file *file)
indydog_alive = 1;
printk(KERN_INFO "Started watchdog timer.\n");
- return 0;
+ return nonseekable_open(inode, file);
}
static int indydog_release(struct inode *inode, struct file *file)
@@ -98,10 +98,6 @@ static int indydog_release(struct inode *inode, struct file *file)
static ssize_t indydog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* Refresh the timer. */
if (len) {
indydog_ping();
diff --git a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c
index 499fffa3e41c53..ebcaf79ce8bcab 100644
--- a/drivers/char/watchdog/ixp2000_wdt.c
+++ b/drivers/char/watchdog/ixp2000_wdt.c
@@ -74,16 +74,12 @@ ixp2000_wdt_open(struct inode *inode, struct file *file)
wdt_enable();
- return 0;
+ return nonseekable_open(inode, file);
}
static ssize_t
ixp2000_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (len) {
if (!nowayout) {
size_t i;
diff --git a/drivers/char/watchdog/ixp4xx_wdt.c b/drivers/char/watchdog/ixp4xx_wdt.c
index 79493650f1bd41..b8e3d91d306669 100644
--- a/drivers/char/watchdog/ixp4xx_wdt.c
+++ b/drivers/char/watchdog/ixp4xx_wdt.c
@@ -69,16 +69,12 @@ ixp4xx_wdt_open(struct inode *inode, struct file *file)
wdt_enable();
- return 0;
+ return nonseekable_open(inode, file);
}
static ssize_t
ixp4xx_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (len) {
if (!nowayout) {
size_t i;
diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c
index e8dc517b44121c..3782930e6f1f07 100644
--- a/drivers/char/watchdog/machzwd.c
+++ b/drivers/char/watchdog/machzwd.c
@@ -305,10 +305,6 @@ static void zf_ping(unsigned long data)
static ssize_t zf_write(struct file *file, const char __user *buf, size_t count,
loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character */
if(count){
@@ -389,7 +385,7 @@ static int zf_open(struct inode *inode, struct file *file)
zf_timer_on();
- return 0;
+ return nonseekable_open(inode, file);
}
static int zf_close(struct inode *inode, struct file *file)
diff --git a/drivers/char/watchdog/mixcomwd.c b/drivers/char/watchdog/mixcomwd.c
index 2790f9c563f6e9..15a3547f24c1e9 100644
--- a/drivers/char/watchdog/mixcomwd.c
+++ b/drivers/char/watchdog/mixcomwd.c
@@ -108,7 +108,7 @@ static int mixcomwd_open(struct inode *inode, struct file *file)
mixcomwd_timer_alive=0;
}
}
- return 0;
+ return nonseekable_open(inode, file);
}
static int mixcomwd_release(struct inode *inode, struct file *file)
@@ -136,10 +136,6 @@ static int mixcomwd_release(struct inode *inode, struct file *file)
static ssize_t mixcomwd_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
{
- if (ppos != &file->f_pos) {
- return -ESPIPE;
- }
-
if(len)
{
if (!nowayout) {
diff --git a/drivers/char/watchdog/pcwd.c b/drivers/char/watchdog/pcwd.c
index 295e11461ec1f1..88bdbda92e49d6 100644
--- a/drivers/char/watchdog/pcwd.c
+++ b/drivers/char/watchdog/pcwd.c
@@ -485,10 +485,6 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
static ssize_t pcwd_write(struct file *file, const char __user *buf, size_t len,
loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (len) {
if (!nowayout) {
size_t i;
@@ -523,7 +519,7 @@ static int pcwd_open(struct inode *inode, struct file *file)
/* Activate */
pcwd_start();
pcwd_keepalive();
- return(0);
+ return nonseekable_open(inode, file);
}
static int pcwd_close(struct inode *inode, struct file *file)
@@ -548,10 +544,6 @@ static ssize_t pcwd_temp_read(struct file *file, char __user *buf, size_t count,
{
int temperature;
- /* Can't seek (pread) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (pcwd_get_temperature(&temperature))
return -EFAULT;
@@ -566,7 +558,7 @@ static int pcwd_temp_open(struct inode *inode, struct file *file)
if (!supports_temp)
return -ENODEV;
- return 0;
+ return nonseekable_open(inode, file);
}
static int pcwd_temp_close(struct inode *inode, struct file *file)
diff --git a/drivers/char/watchdog/pcwd_pci.c b/drivers/char/watchdog/pcwd_pci.c
index ddfeee87875126..7216e4836193fd 100644
--- a/drivers/char/watchdog/pcwd_pci.c
+++ b/drivers/char/watchdog/pcwd_pci.c
@@ -261,10 +261,6 @@ static int pcipcwd_get_temperature(int *temperature)
static ssize_t pcipcwd_write(struct file *file, const char __user *data,
size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if (len) {
if (!nowayout) {
@@ -392,7 +388,7 @@ static int pcipcwd_open(struct inode *inode, struct file *file)
/* Activate */
pcipcwd_start();
pcipcwd_keepalive();
- return 0;
+ return nonseekable_open(inode, file);
}
static int pcipcwd_release(struct inode *inode, struct file *file)
@@ -420,10 +416,6 @@ static ssize_t pcipcwd_temp_read(struct file *file, char __user *data,
{
int temperature;
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (pcipcwd_get_temperature(&temperature))
return -EFAULT;
@@ -438,7 +430,7 @@ static int pcipcwd_temp_open(struct inode *inode, struct file *file)
if (!pcipcwd_private.supports_temp)
return -ENODEV;
- return 0;
+ return nonseekable_open(inode, file);
}
static int pcipcwd_temp_release(struct inode *inode, struct file *file)
diff --git a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c
index 50325530e0e0ef..cdfe0db28784e9 100644
--- a/drivers/char/watchdog/pcwd_usb.c
+++ b/drivers/char/watchdog/pcwd_usb.c
@@ -329,10 +329,6 @@ static int usb_pcwd_get_temperature(struct usb_pcwd_private *usb_pcwd, int *temp
static ssize_t usb_pcwd_write(struct file *file, const char __user *data,
size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if (len) {
if (!nowayout) {
@@ -445,7 +441,7 @@ static int usb_pcwd_open(struct inode *inode, struct file *file)
/* Activate */
usb_pcwd_start(usb_pcwd_device);
usb_pcwd_keepalive(usb_pcwd_device);
- return 0;
+ return nonseekable_open(inode, file);
}
static int usb_pcwd_release(struct inode *inode, struct file *file)
@@ -473,10 +469,6 @@ static ssize_t usb_pcwd_temperature_read(struct file *file, char __user *data,
{
int temperature;
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature))
return -EFAULT;
@@ -488,7 +480,7 @@ static ssize_t usb_pcwd_temperature_read(struct file *file, char __user *data,
static int usb_pcwd_temperature_open(struct inode *inode, struct file *file)
{
- return 0;
+ return nonseekable_open(inode, file);
}
static int usb_pcwd_temperature_release(struct inode *inode, struct file *file)
diff --git a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c
index aa3901fbab26b3..1adf09f83f958e 100644
--- a/drivers/char/watchdog/sa1100_wdt.c
+++ b/drivers/char/watchdog/sa1100_wdt.c
@@ -49,6 +49,7 @@ static int nowayout = 0;
*/
static int sa1100dog_open(struct inode *inode, struct file *file)
{
+ nonseekable_open(inode, file);
if (test_and_set_bit(1,&sa1100wdt_users))
return -EBUSY;
@@ -84,10 +85,6 @@ static int sa1100dog_release(struct inode *inode, struct file *file)
static ssize_t sa1100dog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (len) {
if (!nowayout) {
size_t i;
diff --git a/drivers/char/watchdog/sbc60xxwdt.c b/drivers/char/watchdog/sbc60xxwdt.c
index b1c29907b83c72..d7de9880605a57 100644
--- a/drivers/char/watchdog/sbc60xxwdt.c
+++ b/drivers/char/watchdog/sbc60xxwdt.c
@@ -168,10 +168,6 @@ static void wdt_keepalive(void)
static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
{
- /* We can't seek */
- if(ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if(count)
{
@@ -202,6 +198,8 @@ static ssize_t fop_write(struct file * file, const char __user * buf, size_t cou
static int fop_open(struct inode * inode, struct file * file)
{
+ nonseekable_open(inode, file);
+
/* Just in case we're already talking to someone... */
if(test_and_set_bit(0, &wdt_is_open))
return -EBUSY;
diff --git a/drivers/char/watchdog/sc1200wdt.c b/drivers/char/watchdog/sc1200wdt.c
index df3816173a29c1..9ddebaebeaf59a 100644
--- a/drivers/char/watchdog/sc1200wdt.c
+++ b/drivers/char/watchdog/sc1200wdt.c
@@ -157,6 +157,8 @@ static inline int sc1200wdt_status(void)
static int sc1200wdt_open(struct inode *inode, struct file *file)
{
+ nonseekable_open(inode, file);
+
/* allow one at a time */
if (down_trylock(&open_sem))
return -EBUSY;
@@ -258,9 +260,6 @@ static int sc1200wdt_release(struct inode *inode, struct file *file)
static ssize_t sc1200wdt_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
{
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (len) {
if (!nowayout) {
size_t i;
diff --git a/drivers/char/watchdog/sc520_wdt.c b/drivers/char/watchdog/sc520_wdt.c
index ebd0bb14c0cbb8..8b68721f9a0d74 100644
--- a/drivers/char/watchdog/sc520_wdt.c
+++ b/drivers/char/watchdog/sc520_wdt.c
@@ -227,10 +227,6 @@ static int wdt_set_heartbeat(int t)
static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
{
- /* We can't seek */
- if(ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if(count) {
if (!nowayout) {
@@ -258,6 +254,8 @@ static ssize_t fop_write(struct file * file, const char __user * buf, size_t cou
static int fop_open(struct inode * inode, struct file * file)
{
+ nonseekable_open(inode, file);
+
/* Just in case we're already talking to someone... */
if(test_and_set_bit(0, &wdt_is_open))
return -EBUSY;
diff --git a/drivers/char/watchdog/scx200_wdt.c b/drivers/char/watchdog/scx200_wdt.c
index bc61e82c3a81eb..ed1800cff85bf6 100644
--- a/drivers/char/watchdog/scx200_wdt.c
+++ b/drivers/char/watchdog/scx200_wdt.c
@@ -101,7 +101,7 @@ static int scx200_wdt_open(struct inode *inode, struct file *file)
return -EBUSY;
scx200_wdt_enable();
- return 0;
+ return nonseekable_open(inode, file);
}
static int scx200_wdt_release(struct inode *inode, struct file *file)
@@ -135,9 +135,6 @@ static struct notifier_block scx200_wdt_notifier =
static ssize_t scx200_wdt_write(struct file *file, const char __user *data,
size_t len, loff_t *ppos)
{
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* check for a magic close character */
if (len)
{
diff --git a/drivers/char/watchdog/shwdt.c b/drivers/char/watchdog/shwdt.c
index e4c235de7dca44..3bc9272a474c21 100644
--- a/drivers/char/watchdog/shwdt.c
+++ b/drivers/char/watchdog/shwdt.c
@@ -209,7 +209,7 @@ static int sh_wdt_open(struct inode *inode, struct file *file)
sh_wdt_start();
- return 0;
+ return nonseekable_open(inode, file);
}
/**
@@ -248,10 +248,6 @@ static int sh_wdt_close(struct inode *inode, struct file *file)
static ssize_t sh_wdt_write(struct file *file, const char *buf,
size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
diff --git a/drivers/char/watchdog/softdog.c b/drivers/char/watchdog/softdog.c
index 832590d417d349..117903498a015c 100644
--- a/drivers/char/watchdog/softdog.c
+++ b/drivers/char/watchdog/softdog.c
@@ -141,7 +141,7 @@ static int softdog_open(struct inode *inode, struct file *file)
* Activate timer
*/
softdog_keepalive();
- return 0;
+ return nonseekable_open(inode, file);
}
static int softdog_release(struct inode *inode, struct file *file)
@@ -163,10 +163,6 @@ static int softdog_release(struct inode *inode, struct file *file)
static ssize_t softdog_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/*
* Refresh the timer.
*/
diff --git a/drivers/char/watchdog/w83627hf_wdt.c b/drivers/char/watchdog/w83627hf_wdt.c
index 0a2196231d11c4..813c97038f84ac 100644
--- a/drivers/char/watchdog/w83627hf_wdt.c
+++ b/drivers/char/watchdog/w83627hf_wdt.c
@@ -144,10 +144,6 @@ wdt_set_heartbeat(int t)
static ssize_t
wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
@@ -241,7 +237,7 @@ wdt_open(struct inode *inode, struct file *file)
*/
wdt_ping();
- return 0;
+ return nonseekable_open(inode, file);
}
static int
diff --git a/drivers/char/watchdog/w83877f_wdt.c b/drivers/char/watchdog/w83877f_wdt.c
index 21270dad085911..bccbd4d6ac2d94 100644
--- a/drivers/char/watchdog/w83877f_wdt.c
+++ b/drivers/char/watchdog/w83877f_wdt.c
@@ -190,10 +190,6 @@ static void wdt_keepalive(void)
static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
{
- /* We can't seek */
- if(ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if(count)
{
@@ -230,7 +226,7 @@ static int fop_open(struct inode * inode, struct file * file)
/* Good, fire up the show */
wdt_startup();
- return 0;
+ return nonseekable_open(inode, file);
}
static int fop_close(struct inode * inode, struct file * file)
diff --git a/drivers/char/watchdog/wafer5823wdt.c b/drivers/char/watchdog/wafer5823wdt.c
index 26e232b74d0cb7..abb0bea45c02f8 100644
--- a/drivers/char/watchdog/wafer5823wdt.c
+++ b/drivers/char/watchdog/wafer5823wdt.c
@@ -97,10 +97,6 @@ wafwdt_stop(void)
static ssize_t wafwdt_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if (count) {
if (!nowayout) {
@@ -197,7 +193,7 @@ static int wafwdt_open(struct inode *inode, struct file *file)
* Activate
*/
wafwdt_start();
- return 0;
+ return nonseekable_open(inode, file);
}
static int
diff --git a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c
index 407690ba01f4f7..5684aa37988611 100644
--- a/drivers/char/watchdog/wdt.c
+++ b/drivers/char/watchdog/wdt.c
@@ -288,10 +288,6 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static ssize_t wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if(count) {
if (!nowayout) {
size_t i;
@@ -397,7 +393,7 @@ static int wdt_open(struct inode *inode, struct file *file)
* Activate
*/
wdt_start();
- return 0;
+ return nonseekable_open(inode, file);
}
/**
@@ -441,10 +437,6 @@ static ssize_t wdt_temp_read(struct file *file, char __user *buf, size_t count,
{
int temperature;
- /* Can't seek (pread) on this device */
- if (ptr != &file->f_pos)
- return -ESPIPE;
-
if (wdt_get_temperature(&temperature))
return -EFAULT;
@@ -464,7 +456,7 @@ static ssize_t wdt_temp_read(struct file *file, char __user *buf, size_t count,
static int wdt_temp_open(struct inode *inode, struct file *file)
{
- return 0;
+ return nonseekable_open(inode, file);
}
/**
diff --git a/drivers/char/watchdog/wdt285.c b/drivers/char/watchdog/wdt285.c
index b61d9e1cc43f50..d3fced33d3647c 100644
--- a/drivers/char/watchdog/wdt285.c
+++ b/drivers/char/watchdog/wdt285.c
@@ -97,6 +97,7 @@ static int watchdog_open(struct inode *inode, struct file *file)
ret = 0;
#endif
+ nonseekable_open(inode, file);
return ret;
}
@@ -117,10 +118,6 @@ static int watchdog_release(struct inode *inode, struct file *file)
static ssize_t
watchdog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/*
* Refresh the timer.
*/
diff --git a/drivers/char/watchdog/wdt977.c b/drivers/char/watchdog/wdt977.c
index 5de016ebe2b662..2b7ce1f80596f0 100644
--- a/drivers/char/watchdog/wdt977.c
+++ b/drivers/char/watchdog/wdt977.c
@@ -240,7 +240,7 @@ static int wdt977_open(struct inode *inode, struct file *file)
__module_get(THIS_MODULE);
wdt977_start();
- return 0;
+ return nonseekable_open(inode, file);
}
static int wdt977_release(struct inode *inode, struct file *file)
@@ -275,10 +275,6 @@ static int wdt977_release(struct inode *inode, struct file *file)
static ssize_t wdt977_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
diff --git a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c
index c63d17ff68fcc5..9d5b5f4e5a7f73 100644
--- a/drivers/char/watchdog/wdt_pci.c
+++ b/drivers/char/watchdog/wdt_pci.c
@@ -333,10 +333,6 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
@@ -446,7 +442,7 @@ static int wdtpci_open(struct inode *inode, struct file *file)
* Activate
*/
wdtpci_start();
- return 0;
+ return nonseekable_open(inode, file);
}
/**
@@ -490,10 +486,6 @@ static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, size_t coun
{
int temperature;
- /* Can't seek (pread) on this device */
- if (ptr != &file->f_pos)
- return -ESPIPE;
-
if (wdtpci_get_temperature(&temperature))
return -EFAULT;
@@ -513,7 +505,7 @@ static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, size_t coun
static int wdtpci_temp_open(struct inode *inode, struct file *file)
{
- return 0;
+ return nonseekable_open(inode, file);
}
/**
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 42d7c6b97eb200..3429d57e297eef 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -656,9 +656,6 @@ capi_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
struct sk_buff *skb;
size_t copied;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (!cdev->ap.applid)
return -ENODEV;
@@ -699,9 +696,6 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
struct sk_buff *skb;
u16 mlen;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (!cdev->ap.applid)
return -ENODEV;
@@ -965,7 +959,7 @@ capi_open(struct inode *inode, struct file *file)
if ((file->private_data = capidev_alloc()) == 0)
return -ENOMEM;
- return 0;
+ return nonseekable_open(inode, file);
}
static int
diff --git a/drivers/isdn/hardware/eicon/divamnt.c b/drivers/isdn/hardware/eicon/divamnt.c
index 1d664813f7b6ce..6b22a8a5f307a8 100644
--- a/drivers/isdn/hardware/eicon/divamnt.c
+++ b/drivers/isdn/hardware/eicon/divamnt.c
@@ -151,9 +151,6 @@ maint_read(struct file *file, char __user *buf, size_t count, loff_t * off)
int str_length;
int *str_msg;
- if (off != &file->f_pos)
- return -ESPIPE;
-
if (!file->private_data) {
for (;;) {
while (
@@ -306,7 +303,7 @@ static int maint_open(struct inode *ino, struct file *filep)
filep->private_data = NULL;
- return (0);
+ return nonseekable_open(ino, filep);
}
static int maint_close(struct inode *ino, struct file *filep)
diff --git a/drivers/isdn/hardware/eicon/divasproc.c b/drivers/isdn/hardware/eicon/divasproc.c
index 192fae4c6465ff..55e83d1885d089 100644
--- a/drivers/isdn/hardware/eicon/divasproc.c
+++ b/drivers/isdn/hardware/eicon/divasproc.c
@@ -63,8 +63,6 @@ divas_read(struct file *file, char __user *buf, size_t count, loff_t * off)
if (*off)
return 0;
- if (off != &file->f_pos)
- return -ESPIPE;
divas_get_version(tmpbuf);
if (copy_to_user(buf + len, &tmpbuf, strlen(tmpbuf)))
@@ -107,7 +105,7 @@ static unsigned int divas_poll(struct file *file, poll_table * wait)
static int divas_open(struct inode *inode, struct file *file)
{
- return (0);
+ return nonseekable_open(inode, file);
}
static int divas_close(struct inode *inode, struct file *file)
diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c
index a0983206dcf9aa..5da507e532fc5e 100644
--- a/drivers/isdn/hysdn/hysdn_procconf.c
+++ b/drivers/isdn/hysdn/hysdn_procconf.c
@@ -95,8 +95,6 @@ hysdn_conf_write(struct file *file, const char __user *buf, size_t count, loff_t
int i;
uchar ch, *cp;
- if (&file->f_pos != off) /* fs error check */
- return (-ESPIPE);
if (!count)
return (0); /* nothing to handle */
@@ -214,9 +212,6 @@ hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t * off)
char *cp;
int i;
- if (off != &file->f_pos) /* fs error check */
- return -ESPIPE;
-
if (file->f_mode & FMODE_READ) {
if (!(cp = file->private_data))
return (-EFAULT); /* should never happen */
@@ -320,7 +315,7 @@ hysdn_conf_open(struct inode *ino, struct file *filep)
return (-EPERM); /* no permission this time */
}
unlock_kernel();
- return (0);
+ return nonseekable_open(ino, filep);
} /* hysdn_conf_open */
/***************************/
diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c
index 648e032868f191..a5477cc4eaf521 100644
--- a/drivers/isdn/hysdn/hysdn_proclog.c
+++ b/drivers/isdn/hysdn/hysdn_proclog.c
@@ -158,9 +158,6 @@ hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t
long base = 10;
hysdn_card *card = (hysdn_card *) file->private_data;
- if (&file->f_pos != off) /* fs error check */
- return (-ESPIPE);
-
if (count > (sizeof(valbuf) - 1))
count = sizeof(valbuf) - 1; /* limit length */
if (copy_from_user(valbuf, buf, count))
@@ -285,7 +282,7 @@ hysdn_log_open(struct inode *ino, struct file *filep)
return (-EPERM); /* no permission this time */
}
unlock_kernel();
- return (0);
+ return nonseekable_open(ino, filep);
} /* hysdn_log_open */
/*******************************************************************************/
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index eb71c80924a058..4956e2e0201852 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -946,9 +946,6 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off)
int retval;
char *p;
- if (off != &file->f_pos)
- return -ESPIPE;
-
lock_kernel();
if (minor == ISDN_MINOR_STATUS) {
if (!file->private_data) {
@@ -1051,9 +1048,6 @@ isdn_write(struct file *file, const char __user *buf, size_t count, loff_t * off
int chidx;
int retval;
- if (off != &file->f_pos)
- return -ESPIPE;
-
if (minor == ISDN_MINOR_STATUS)
return -EPERM;
if (!dev->drivers)
@@ -1659,6 +1653,7 @@ isdn_open(struct inode *ino, struct file *filep)
}
#endif
out:
+ nonseekable_open(ino, filep);
return retval;
}
diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c
index 0d0343b87a0076..86262a13f7c60d 100644
--- a/drivers/s390/char/tape_char.c
+++ b/drivers/s390/char/tape_char.c
@@ -145,16 +145,6 @@ tapechar_read(struct file *filp, char __user *data, size_t count, loff_t *ppos)
DBF_EVENT(6, "TCHAR:read\n");
device = (struct tape_device *) filp->private_data;
- /* Check position. */
- if (ppos != &filp->f_pos) {
- /*
- * "A request was outside the capabilities of the device."
- * This check uses internal knowledge about how pread and
- * read work...
- */
- DBF_EVENT(6, "TCHAR:ppos wrong\n");
- return -EOVERFLOW;
- }
/*
* If the tape isn't terminated yet, do it now. And since we then
@@ -221,12 +211,6 @@ tapechar_write(struct file *filp, const char __user *data, size_t count, loff_t
DBF_EVENT(6, "TCHAR:write\n");
device = (struct tape_device *) filp->private_data;
- /* Check position */
- if (ppos != &filp->f_pos) {
- /* "A request was outside the capabilities of the device." */
- DBF_EVENT(6, "TCHAR:ppos wrong\n");
- return -EOVERFLOW;
- }
/* Find out block size and number of blocks */
if (device->char_data.block_size != 0) {
if (count < device->char_data.block_size) {
@@ -329,7 +313,7 @@ tapechar_open (struct inode *inode, struct file *filp)
rc = tape_open(device);
if (rc == 0) {
filp->private_data = device;
- return 0;
+ return nonseekable_open(inode, filp);
}
tape_put_device(device);
diff --git a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c
index 32375549886776..ad870a300a1a7f 100644
--- a/drivers/sbus/char/cpwatchdog.c
+++ b/drivers/sbus/char/cpwatchdog.c
@@ -324,7 +324,7 @@ static int wd_open(struct inode *inode, struct file *f)
wd_dev.initialized = 1;
}
- return(0);
+ return(nonseekable_open(inode, f));
}
static int wd_release(struct inode *inode, struct file *file)
@@ -419,9 +419,6 @@ static ssize_t wd_write(struct file *file,
return(-EINVAL);
}
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
wd_pingtimer(pTimer);
return 1;
diff --git a/drivers/sbus/char/riowatchdog.c b/drivers/sbus/char/riowatchdog.c
index 0e8d06ea8d61c7..7f8e109f93c121 100644
--- a/drivers/sbus/char/riowatchdog.c
+++ b/drivers/sbus/char/riowatchdog.c
@@ -116,6 +116,7 @@ static void riowd_starttimer(void)
static int riowd_open(struct inode *inode, struct file *filp)
{
+ nonseekable_open(inode, filp);
return 0;
}
@@ -184,9 +185,6 @@ static int riowd_ioctl(struct inode *inode, struct file *filp,
static ssize_t riowd_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
riowd_pingtimer();
return 1;
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index 9d0cab9ced292e..fb74a2f64cd515 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -3185,12 +3185,6 @@ static ssize_t osst_write(struct file * filp, const char __user * buf, size_t co
goto out;
}
- if (ppos != &filp->f_pos) {
- /* "A request was outside the capabilities of the device." */
- retval = (-ENXIO);
- goto out;
- }
-
if (STp->ready != ST_READY) {
if (STp->ready == ST_NO_TAPE)
retval = (-ENOMEDIUM);
@@ -3512,12 +3506,6 @@ static ssize_t osst_read(struct file * filp, char __user * buf, size_t count, lo
goto out;
}
- if (ppos != &filp->f_pos) {
- /* "A request was outside the capabilities of the device." */
- retval = (-ENXIO);
- goto out;
- }
-
if (STp->ready != ST_READY) {
if (STp->ready == ST_NO_TAPE)
retval = (-ENOMEDIUM);
@@ -4254,6 +4242,7 @@ static int os_scsi_tape_open(struct inode * inode, struct file * filp)
int dev = TAPE_NR(inode);
int mode = TAPE_MODE(inode);
+ nonseekable_open(inode, filp);
write_lock(&os_scsi_tapes_lock);
if (dev >= osst_max_dev || os_scsi_tapes == NULL ||
(STp = os_scsi_tapes[dev]) == NULL || !STp->device) {
diff --git a/drivers/usb/class/audio.c b/drivers/usb/class/audio.c
index 648bbb033bb2b0..42f60fa37d2495 100644
--- a/drivers/usb/class/audio.c
+++ b/drivers/usb/class/audio.c
@@ -1974,7 +1974,7 @@ static int usb_audio_open_mixdev(struct inode *inode, struct file *file)
s->count++;
up(&open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int usb_audio_release_mixdev(struct inode *inode, struct file *file)
@@ -2147,8 +2147,6 @@ static ssize_t usb_audio_read(struct file *file, char __user *buffer, size_t cou
unsigned int ptr;
int cnt, err;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (as->usbin.dma.mapped)
return -ENXIO;
if (!as->usbin.dma.ready && (ret = prog_dmabuf_in(as)))
@@ -2216,8 +2214,6 @@ static ssize_t usb_audio_write(struct file *file, const char __user *buffer, siz
unsigned int start_thr;
int cnt, err;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (as->usbout.dma.mapped)
return -ENXIO;
if (!as->usbout.dma.ready && (ret = prog_dmabuf_out(as)))
@@ -2688,7 +2684,7 @@ static int usb_audio_open(struct inode *inode, struct file *file)
as->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
s->count++;
up(&open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int usb_audio_release(struct inode *inode, struct file *file)
diff --git a/drivers/usb/class/usb-midi.c b/drivers/usb/class/usb-midi.c
index 0223d3c4b14ac7..6a6dbac4987e6c 100644
--- a/drivers/usb/class/usb-midi.c
+++ b/drivers/usb/class/usb-midi.c
@@ -646,9 +646,6 @@ static ssize_t usb_midi_read(struct file *file, char __user *buffer, size_t coun
ssize_t ret;
DECLARE_WAITQUEUE(wait, current);
- if ( ppos != &file->f_pos ) {
- return -ESPIPE;
- }
if ( !access_ok(VERIFY_READ, buffer, count) ) {
return -EFAULT;
}
@@ -728,9 +725,6 @@ static ssize_t usb_midi_write(struct file *file, const char __user *buffer, size
ssize_t ret;
unsigned long int flags;
- if ( ppos != &file->f_pos ) {
- return -ESPIPE;
- }
if ( !access_ok(VERIFY_READ, buffer, count) ) {
return -EFAULT;
}
@@ -920,7 +914,7 @@ static int usb_midi_open(struct inode *inode, struct file *file)
printk(KERN_INFO "usb-midi: Open Succeeded. minor= %d.\n", minor);
#endif
- return 0; /** Success. **/
+ return nonseekable_open(inode, file); /** Success. **/
}
diff --git a/drivers/usb/media/dabusb.c b/drivers/usb/media/dabusb.c
index 2c021bfec27f6e..01f77cbc4d1c20 100644
--- a/drivers/usb/media/dabusb.c
+++ b/drivers/usb/media/dabusb.c
@@ -616,7 +616,7 @@ static int dabusb_open (struct inode *inode, struct file *file)
file->f_pos = 0;
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int dabusb_release (struct inode *inode, struct file *file)
diff --git a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c
index 3a61a0b77f8768..310c5a96c6f536 100644
--- a/drivers/usb/misc/auerswald.c
+++ b/drivers/usb/misc/auerswald.c
@@ -1435,7 +1435,7 @@ static int auerchar_open (struct inode *inode, struct file *file)
/* file IO stuff */
file->f_pos = 0;
file->private_data = ccp;
- return 0;
+ return nonseekable_open(inode, file);
/* Error exit */
ofail: up (&cp->mutex);
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index 8e266eba061cee..cd7b548b9cc2bb 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -344,6 +344,7 @@ static int tower_open (struct inode *inode, struct file *file)
dbg(2, "%s: enter", __FUNCTION__);
+ nonseekable_open(inode, file);
subminor = iminor(inode);
down (&disconnect_sem);
diff --git a/drivers/usb/misc/tiglusb.c b/drivers/usb/misc/tiglusb.c
index 51717375a8c0db..cdf5919f8865c2 100644
--- a/drivers/usb/misc/tiglusb.c
+++ b/drivers/usb/misc/tiglusb.c
@@ -132,7 +132,7 @@ tiglusb_open (struct inode *inode, struct file *filp)
filp->f_pos = 0;
filp->private_data = s;
- return 0;
+ return nonseekable_open(inode, filp);
}
static int