diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-08-07 05:11:39 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-08-07 05:11:39 -0700 |
commit | 6244f13c51282d9f6203243b652839dff24b762f (patch) | |
tree | 78e5f97623589a562c9cf075a7e9a3e0e0331c5c /drivers | |
parent | 2f90403a2d4c5021726c89c3e66e4f59096e0840 (diff) | |
download | history-6244f13c51282d9f6203243b652839dff24b762f.tar.gz |
Fix up a couple of drivers - notable sg - for nonseekability.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/ds1620.c | 5 | ||||
-rw-r--r-- | drivers/char/dtlk.c | 5 | ||||
-rw-r--r-- | drivers/scsi/sg.c | 3 |
3 files changed, 3 insertions, 10 deletions
diff --git a/drivers/char/ds1620.c b/drivers/char/ds1620.c index 4171ca18b62981..8e290a3e7fdde7 100644 --- a/drivers/char/ds1620.c +++ b/drivers/char/ds1620.c @@ -218,10 +218,6 @@ ds1620_read(struct file *file, char *buf, size_t count, loff_t *ptr) signed int cur_temp; signed char cur_temp_degF; - /* Can't seek (pread) on this device */ - if (ptr != &file->f_pos) - return -ESPIPE; - cur_temp = cvt_9_to_int(ds1620_in(THERM_READ_TEMP, 9)) >> 1; /* convert to Fahrenheit, as per wdt.c */ @@ -338,6 +334,7 @@ static struct proc_dir_entry *proc_therm_ds1620; static struct file_operations ds1620_fops = { .owner = THIS_MODULE, + .open = nonseekable_open, .read = ds1620_read, .ioctl = ds1620_ioctl, }; diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c index e6ad246b9527ca..22c6a921e6bb31 100644 --- a/drivers/char/dtlk.c +++ b/drivers/char/dtlk.c @@ -128,10 +128,6 @@ static ssize_t dtlk_read(struct file *file, char __user *buf, char ch; int i = 0, retries; - /* Can't seek (pread) on the DoubleTalk. */ - if (ppos != &file->f_pos) - return -ESPIPE; - TRACE_TEXT("(dtlk_read"); /* printk("DoubleTalk PC - dtlk_read()\n"); */ @@ -303,6 +299,7 @@ static int dtlk_open(struct inode *inode, struct file *file) { TRACE_TEXT("(dtlk_open"); + nonseekable_open(inode, file); switch (iminor(inode)) { case DTLK_MINOR: if (dtlk_busy) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 8ccc7d9142c91e..7b0665d8ba1e09 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -234,6 +234,7 @@ sg_open(struct inode *inode, struct file *filp) int res; int retval; + nonseekable_open(inode, filp); SCSI_LOG_TIMEOUT(3, printk("sg_open: dev=%d, flags=0x%x\n", dev, flags)); sdp = sg_get_dev(dev); if ((!sdp) || (!sdp->device)) @@ -343,7 +344,6 @@ sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) return -ENXIO; SCSI_LOG_TIMEOUT(3, printk("sg_read: %s, count=%d\n", sdp->disk->disk_name, (int) count)); - if (ppos != &filp->f_pos) ; /* FIXME: Hmm. Seek to the right place, or fail? */ if ((k = verify_area(VERIFY_WRITE, buf, count))) return k; if (sfp->force_packid && (count >= SZ_SG_HEADER)) { @@ -501,7 +501,6 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) if (!((filp->f_flags & O_NONBLOCK) || scsi_block_when_processing_errors(sdp->device))) return -ENXIO; - if (ppos != &filp->f_pos) ; /* FIXME: Hmm. Seek to the right place, or fail? */ if ((k = verify_area(VERIFY_READ, buf, count))) return k; /* protects following copy_from_user()s + get_user()s */ |