diff options
author | Jan Blunck <jblunck@suse.de> | 2010-04-27 21:48:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-27 21:48:52 -0400 |
commit | be94bbb5db4de0f3a2a5405511ea3ebea261f2c8 (patch) | |
tree | d00c309d4b9e80acf9e16ea398f2b7d410226325 /drivers/sbus | |
parent | 667f0cee3e0321151aa7a1a5222afe67ca4be0ea (diff) |
drivers/sbus/char/flash.c: flash_read should update ppos instead of file->f_pos
flash_read() updates file->f_pos directly instead of the ppos given. The
VFS later updates the file->f_pos and overwrites it with the unchanged
value of ppos.
Signed-off-by: Jan Blunck <jblunck@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/sbus')
-rw-r--r-- | drivers/sbus/char/flash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index 19f255b97c86..d3b62eb0fba7 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c | |||
@@ -105,9 +105,9 @@ static ssize_t | |||
105 | flash_read(struct file * file, char __user * buf, | 105 | flash_read(struct file * file, char __user * buf, |
106 | size_t count, loff_t *ppos) | 106 | size_t count, loff_t *ppos) |
107 | { | 107 | { |
108 | unsigned long p = file->f_pos; | 108 | loff_t p = *ppos; |
109 | int i; | 109 | int i; |
110 | 110 | ||
111 | if (count > flash.read_size - p) | 111 | if (count > flash.read_size - p) |
112 | count = flash.read_size - p; | 112 | count = flash.read_size - p; |
113 | 113 | ||
@@ -118,7 +118,7 @@ flash_read(struct file * file, char __user * buf, | |||
118 | buf++; | 118 | buf++; |
119 | } | 119 | } |
120 | 120 | ||
121 | file->f_pos += count; | 121 | *ppos += count; |
122 | return count; | 122 | return count; |
123 | } | 123 | } |
124 | 124 | ||