aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-08-19 12:06:18 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-10-09 02:39:06 -0400
commit1a37f5ecb707aded73133e14b58102343de56bbd (patch)
treedd86fa042e04ee1d7726ffb8dec69d330769da31 /drivers/misc
parent2ec3a12a667847d303d4d0c0576d5ff388052b48 (diff)
carma-fpga: switch to fixed_size_llseek()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/carma/carma-fpga-program.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/misc/carma/carma-fpga-program.c b/drivers/misc/carma/carma-fpga-program.c
index 7be89832db19..f390deeae3cf 100644
--- a/drivers/misc/carma/carma-fpga-program.c
+++ b/drivers/misc/carma/carma-fpga-program.c
@@ -767,26 +767,7 @@ static loff_t fpga_llseek(struct file *filp, loff_t offset, int origin)
767 if ((filp->f_flags & O_ACCMODE) != O_RDONLY) 767 if ((filp->f_flags & O_ACCMODE) != O_RDONLY)
768 return -EINVAL; 768 return -EINVAL;
769 769
770 switch (origin) { 770 return fixed_size_llseek(file, offset, origin, priv->fw_size);
771 case SEEK_SET: /* seek relative to the beginning of the file */
772 newpos = offset;
773 break;
774 case SEEK_CUR: /* seek relative to current position in the file */
775 newpos = filp->f_pos + offset;
776 break;
777 case SEEK_END: /* seek relative to the end of the file */
778 newpos = priv->fw_size - offset;
779 break;
780 default:
781 return -EINVAL;
782 }
783
784 /* check for sanity */
785 if (newpos > priv->fw_size)
786 return -EINVAL;
787
788 filp->f_pos = newpos;
789 return newpos;
790} 771}
791 772
792static const struct file_operations fpga_fops = { 773static const struct file_operations fpga_fops = {