diff options
Diffstat (limited to 'drivers/pci/proc.c')
-rw-r--r-- | drivers/pci/proc.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index 0b009470e6db..12e4fb5824c1 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c | |||
@@ -46,9 +46,7 @@ proc_bus_pci_lseek(struct file *file, loff_t off, int whence) | |||
46 | static ssize_t | 46 | static ssize_t |
47 | proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) | 47 | proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) |
48 | { | 48 | { |
49 | const struct inode *ino = file_inode(file); | 49 | struct pci_dev *dev = PDE_DATA(file_inode(file)); |
50 | const struct proc_dir_entry *dp = PDE(ino); | ||
51 | struct pci_dev *dev = dp->data; | ||
52 | unsigned int pos = *ppos; | 50 | unsigned int pos = *ppos; |
53 | unsigned int cnt, size; | 51 | unsigned int cnt, size; |
54 | 52 | ||
@@ -59,7 +57,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp | |||
59 | */ | 57 | */ |
60 | 58 | ||
61 | if (capable(CAP_SYS_ADMIN)) | 59 | if (capable(CAP_SYS_ADMIN)) |
62 | size = dp->size; | 60 | size = dev->cfg_size; |
63 | else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) | 61 | else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) |
64 | size = 128; | 62 | size = 128; |
65 | else | 63 | else |
@@ -133,10 +131,9 @@ static ssize_t | |||
133 | proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, loff_t *ppos) | 131 | proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, loff_t *ppos) |
134 | { | 132 | { |
135 | struct inode *ino = file_inode(file); | 133 | struct inode *ino = file_inode(file); |
136 | const struct proc_dir_entry *dp = PDE(ino); | 134 | struct pci_dev *dev = PDE_DATA(ino); |
137 | struct pci_dev *dev = dp->data; | ||
138 | int pos = *ppos; | 135 | int pos = *ppos; |
139 | int size = dp->size; | 136 | int size = dev->cfg_size; |
140 | int cnt; | 137 | int cnt; |
141 | 138 | ||
142 | if (pos >= size) | 139 | if (pos >= size) |
@@ -200,7 +197,7 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof | |||
200 | pci_config_pm_runtime_put(dev); | 197 | pci_config_pm_runtime_put(dev); |
201 | 198 | ||
202 | *ppos = pos; | 199 | *ppos = pos; |
203 | i_size_write(ino, dp->size); | 200 | i_size_write(ino, dev->cfg_size); |
204 | return nbytes; | 201 | return nbytes; |
205 | } | 202 | } |
206 | 203 | ||
@@ -212,8 +209,7 @@ struct pci_filp_private { | |||
212 | static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, | 209 | static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, |
213 | unsigned long arg) | 210 | unsigned long arg) |
214 | { | 211 | { |
215 | const struct proc_dir_entry *dp = PDE(file_inode(file)); | 212 | struct pci_dev *dev = PDE_DATA(file_inode(file)); |
216 | struct pci_dev *dev = dp->data; | ||
217 | #ifdef HAVE_PCI_MMAP | 213 | #ifdef HAVE_PCI_MMAP |
218 | struct pci_filp_private *fpriv = file->private_data; | 214 | struct pci_filp_private *fpriv = file->private_data; |
219 | #endif /* HAVE_PCI_MMAP */ | 215 | #endif /* HAVE_PCI_MMAP */ |
@@ -253,9 +249,7 @@ static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, | |||
253 | #ifdef HAVE_PCI_MMAP | 249 | #ifdef HAVE_PCI_MMAP |
254 | static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) | 250 | static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) |
255 | { | 251 | { |
256 | struct inode *inode = file_inode(file); | 252 | struct pci_dev *dev = PDE_DATA(file_inode(file)); |
257 | const struct proc_dir_entry *dp = PDE(inode); | ||
258 | struct pci_dev *dev = dp->data; | ||
259 | struct pci_filp_private *fpriv = file->private_data; | 253 | struct pci_filp_private *fpriv = file->private_data; |
260 | int i, ret; | 254 | int i, ret; |
261 | 255 | ||