carma-fpga: switch to simple_read_from_buffer()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
1a37f5ecb7
commit
d88c242623
|
@ -749,13 +749,8 @@ static ssize_t fpga_read(struct file *filp, char __user *buf, size_t count,
|
||||||
loff_t *f_pos)
|
loff_t *f_pos)
|
||||||
{
|
{
|
||||||
struct fpga_dev *priv = filp->private_data;
|
struct fpga_dev *priv = filp->private_data;
|
||||||
|
return simple_read_from_buffer(buf, count, ppos,
|
||||||
count = min_t(size_t, priv->bytes - *f_pos, count);
|
priv->vb.vaddr, priv->bytes);
|
||||||
if (copy_to_user(buf, priv->vb.vaddr + *f_pos, count))
|
|
||||||
return -EFAULT;
|
|
||||||
|
|
||||||
*f_pos += count;
|
|
||||||
return count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static loff_t fpga_llseek(struct file *filp, loff_t offset, int origin)
|
static loff_t fpga_llseek(struct file *filp, loff_t offset, int origin)
|
||||||
|
|
Loading…
Reference in New Issue