Commit 6244f13c authored by Linus Torvalds's avatar Linus Torvalds

Fix up a couple of drivers - notable sg - for nonseekability.

parent 2f90403a
......@@ -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,
};
......
......@@ -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)
......
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment