Commit 914961aac077b5aebb4ae669d7c42d231826970b

Authored by Al Viro
1 parent b33159b7d2

tile-srom: switch to fixed_size_llseek()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Showing 1 changed file with 3 additions and 25 deletions Side-by-side Diff

drivers/char/tile-srom.c
... ... @@ -273,32 +273,10 @@
273 273 }
274 274  
275 275 /* Provide our own implementation so we can use srom->total_size. */
276   -loff_t srom_llseek(struct file *filp, loff_t offset, int origin)
  276 +loff_t srom_llseek(struct file *file, loff_t offset, int origin)
277 277 {
278   - struct srom_dev *srom = filp->private_data;
279   -
280   - if (mutex_lock_interruptible(&srom->lock))
281   - return -ERESTARTSYS;
282   -
283   - switch (origin) {
284   - case SEEK_END:
285   - offset += srom->total_size;
286   - break;
287   - case SEEK_CUR:
288   - offset += filp->f_pos;
289   - break;
290   - }
291   -
292   - if (offset < 0 || offset > srom->total_size) {
293   - offset = -EINVAL;
294   - } else {
295   - filp->f_pos = offset;
296   - filp->f_version = 0;
297   - }
298   -
299   - mutex_unlock(&srom->lock);
300   -
301   - return offset;
  278 + struct srom_dev *srom = file->private_data;
  279 + return fixed_size_llseek(file, offset, origin, srom->total_size);
302 280 }
303 281  
304 282 static ssize_t total_show(struct device *dev,