Skip to content

Commit

Permalink
carma-fpga: switch to simple_read_from_buffer()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Oct 9, 2014
1 parent 1a37f5e commit d88c242
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/misc/carma/carma-fpga-program.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,13 +749,8 @@ static ssize_t fpga_read(struct file *filp, char __user *buf, size_t count,
loff_t *f_pos)
{
struct fpga_dev *priv = filp->private_data;

count = min_t(size_t, priv->bytes - *f_pos, count);
if (copy_to_user(buf, priv->vb.vaddr + *f_pos, count))
return -EFAULT;

*f_pos += count;
return count;
return simple_read_from_buffer(buf, count, ppos,
priv->vb.vaddr, priv->bytes);
}

static loff_t fpga_llseek(struct file *filp, loff_t offset, int origin)
Expand Down

0 comments on commit d88c242

Please sign in to comment.