aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/proc.c')
-rw-r--r--drivers/pci/proc.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index 7b5e45b2fd16..963a97642ae9 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -293,6 +293,7 @@ static int proc_bus_pci_release(struct inode *inode, struct file *file)
293#endif /* HAVE_PCI_MMAP */ 293#endif /* HAVE_PCI_MMAP */
294 294
295static const struct file_operations proc_bus_pci_operations = { 295static const struct file_operations proc_bus_pci_operations = {
296 .owner = THIS_MODULE,
296 .llseek = proc_bus_pci_lseek, 297 .llseek = proc_bus_pci_lseek,
297 .read = proc_bus_pci_read, 298 .read = proc_bus_pci_read,
298 .write = proc_bus_pci_write, 299 .write = proc_bus_pci_write,
@@ -406,11 +407,10 @@ int pci_proc_attach_device(struct pci_dev *dev)
406 } 407 }
407 408
408 sprintf(name, "%02x.%x", PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); 409 sprintf(name, "%02x.%x", PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
409 e = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUSR, bus->procdir); 410 e = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUSR, bus->procdir,
411 &proc_bus_pci_operations, dev);
410 if (!e) 412 if (!e)
411 return -ENOMEM; 413 return -ENOMEM;
412 e->proc_fops = &proc_bus_pci_operations;
413 e->data = dev;
414 e->size = dev->cfg_size; 414 e->size = dev->cfg_size;
415 dev->procent = e; 415 dev->procent = e;
416 416
@@ -462,6 +462,7 @@ static int proc_bus_pci_dev_open(struct inode *inode, struct file *file)
462 return seq_open(file, &proc_bus_pci_devices_op); 462 return seq_open(file, &proc_bus_pci_devices_op);
463} 463}
464static const struct file_operations proc_bus_pci_dev_operations = { 464static const struct file_operations proc_bus_pci_dev_operations = {
465 .owner = THIS_MODULE,
465 .open = proc_bus_pci_dev_open, 466 .open = proc_bus_pci_dev_open,
466 .read = seq_read, 467 .read = seq_read,
467 .llseek = seq_lseek, 468 .llseek = seq_lseek,
@@ -470,12 +471,10 @@ static const struct file_operations proc_bus_pci_dev_operations = {
470 471
471static int __init pci_proc_init(void) 472static int __init pci_proc_init(void)
472{ 473{
473 struct proc_dir_entry *entry;
474 struct pci_dev *dev = NULL; 474 struct pci_dev *dev = NULL;
475 proc_bus_pci_dir = proc_mkdir("bus/pci", NULL); 475 proc_bus_pci_dir = proc_mkdir("bus/pci", NULL);
476 entry = create_proc_entry("devices", 0, proc_bus_pci_dir); 476 proc_create("devices", 0, proc_bus_pci_dir,
477 if (entry) 477 &proc_bus_pci_dev_operations);
478 entry->proc_fops = &proc_bus_pci_dev_operations;
479 proc_initialized = 1; 478 proc_initialized = 1;
480 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 479 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
481 pci_proc_attach_device(dev); 480 pci_proc_attach_device(dev);