|
@@ -293,6 +293,7 @@ static int proc_bus_pci_release(struct inode *inode, struct file *file)
|
|
#endif /* HAVE_PCI_MMAP */
|
|
#endif /* HAVE_PCI_MMAP */
|
|
|
|
|
|
static const struct file_operations proc_bus_pci_operations = {
|
|
static const struct file_operations proc_bus_pci_operations = {
|
|
|
|
+ .owner = THIS_MODULE,
|
|
.llseek = proc_bus_pci_lseek,
|
|
.llseek = proc_bus_pci_lseek,
|
|
.read = proc_bus_pci_read,
|
|
.read = proc_bus_pci_read,
|
|
.write = proc_bus_pci_write,
|
|
.write = proc_bus_pci_write,
|
|
@@ -406,11 +407,10 @@ int pci_proc_attach_device(struct pci_dev *dev)
|
|
}
|
|
}
|
|
|
|
|
|
sprintf(name, "%02x.%x", PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
|
|
sprintf(name, "%02x.%x", PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
|
|
- e = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUSR, bus->procdir);
|
|
|
|
|
|
+ e = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUSR, bus->procdir,
|
|
|
|
+ &proc_bus_pci_operations, dev);
|
|
if (!e)
|
|
if (!e)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
- e->proc_fops = &proc_bus_pci_operations;
|
|
|
|
- e->data = dev;
|
|
|
|
e->size = dev->cfg_size;
|
|
e->size = dev->cfg_size;
|
|
dev->procent = e;
|
|
dev->procent = e;
|
|
|
|
|
|
@@ -462,6 +462,7 @@ static int proc_bus_pci_dev_open(struct inode *inode, struct file *file)
|
|
return seq_open(file, &proc_bus_pci_devices_op);
|
|
return seq_open(file, &proc_bus_pci_devices_op);
|
|
}
|
|
}
|
|
static const struct file_operations proc_bus_pci_dev_operations = {
|
|
static const struct file_operations proc_bus_pci_dev_operations = {
|
|
|
|
+ .owner = THIS_MODULE,
|
|
.open = proc_bus_pci_dev_open,
|
|
.open = proc_bus_pci_dev_open,
|
|
.read = seq_read,
|
|
.read = seq_read,
|
|
.llseek = seq_lseek,
|
|
.llseek = seq_lseek,
|
|
@@ -470,12 +471,10 @@ static const struct file_operations proc_bus_pci_dev_operations = {
|
|
|
|
|
|
static int __init pci_proc_init(void)
|
|
static int __init pci_proc_init(void)
|
|
{
|
|
{
|
|
- struct proc_dir_entry *entry;
|
|
|
|
struct pci_dev *dev = NULL;
|
|
struct pci_dev *dev = NULL;
|
|
proc_bus_pci_dir = proc_mkdir("bus/pci", NULL);
|
|
proc_bus_pci_dir = proc_mkdir("bus/pci", NULL);
|
|
- entry = create_proc_entry("devices", 0, proc_bus_pci_dir);
|
|
|
|
- if (entry)
|
|
|
|
- entry->proc_fops = &proc_bus_pci_dev_operations;
|
|
|
|
|
|
+ proc_create("devices", 0, proc_bus_pci_dir,
|
|
|
|
+ &proc_bus_pci_dev_operations);
|
|
proc_initialized = 1;
|
|
proc_initialized = 1;
|
|
while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
|
|
while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
|
|
pci_proc_attach_device(dev);
|
|
pci_proc_attach_device(dev);
|