diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-23 04:29:00 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 04:57:48 -0400 |
commit | 54de90d686eacd4a761f7ce65c54f1eb3a159429 (patch) | |
tree | 794d1fea72b45d89bca88fbe9a14a6f1f5b2f97f /drivers/pci/proc.c | |
parent | c09ed2a6fafe0d4e506b9f2c36a47cf187509885 (diff) |
pci/proc: switch to fixed_size_llseek()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/pci/proc.c')
-rw-r--r-- | drivers/pci/proc.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index 08126087ec31..cdc7836d7e3d 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c | |||
@@ -20,27 +20,8 @@ static int proc_initialized; /* = 0 */ | |||
20 | static loff_t | 20 | static loff_t |
21 | proc_bus_pci_lseek(struct file *file, loff_t off, int whence) | 21 | proc_bus_pci_lseek(struct file *file, loff_t off, int whence) |
22 | { | 22 | { |
23 | loff_t new = -1; | 23 | struct pci_dev *dev = PDE_DATA(file_inode(file)); |
24 | struct inode *inode = file_inode(file); | 24 | return fixed_size_llseek(file, off, whence, dev->cfg_size); |
25 | |||
26 | mutex_lock(&inode->i_mutex); | ||
27 | switch (whence) { | ||
28 | case 0: | ||
29 | new = off; | ||
30 | break; | ||
31 | case 1: | ||
32 | new = file->f_pos + off; | ||
33 | break; | ||
34 | case 2: | ||
35 | new = inode->i_size + off; | ||
36 | break; | ||
37 | } | ||
38 | if (new < 0 || new > inode->i_size) | ||
39 | new = -EINVAL; | ||
40 | else | ||
41 | file->f_pos = new; | ||
42 | mutex_unlock(&inode->i_mutex); | ||
43 | return new; | ||
44 | } | 25 | } |
45 | 26 | ||
46 | static ssize_t | 27 | static ssize_t |