aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-sysfs.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-06-13 14:45:17 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 19:09:06 -0400
commit7b595756ec1f49e0049a9e01a1298d53a7faaa15 (patch)
treecd06687ab3e5c7a5a4ef91903dff207a18c4db76 /drivers/pci/pci-sysfs.c
parentdbde0fcf9f8f6d477af3c32d9979e789ee680cde (diff)
sysfs: kill unnecessary attribute->owner
sysfs is now completely out of driver/module lifetime game. After deletion, a sysfs node doesn't access anything outside sysfs proper, so there's no reason to hold onto the attribute owners. Note that often the wrong modules were accounted for as owners leading to accessing removed modules. This patch kills now unnecessary attribute->owner. Note that with this change, userland holding a sysfs node does not prevent the backing module from being unloaded. For more info regarding lifetime rule cleanup, please read the following message. http://article.gmane.org/gmane.linux.kernel/510293 (tweaked by Greg to not delete the field just yet, to make it easier to merge things properly.) Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/pci-sysfs.c')
-rw-r--r--drivers/pci/pci-sysfs.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 284e83a527f9..d448f8df8613 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -499,7 +499,6 @@ static int pci_create_resource_files(struct pci_dev *pdev)
499 sprintf(res_attr_name, "resource%d", i); 499 sprintf(res_attr_name, "resource%d", i);
500 res_attr->attr.name = res_attr_name; 500 res_attr->attr.name = res_attr_name;
501 res_attr->attr.mode = S_IRUSR | S_IWUSR; 501 res_attr->attr.mode = S_IRUSR | S_IWUSR;
502 res_attr->attr.owner = THIS_MODULE;
503 res_attr->size = pci_resource_len(pdev, i); 502 res_attr->size = pci_resource_len(pdev, i);
504 res_attr->mmap = pci_mmap_resource; 503 res_attr->mmap = pci_mmap_resource;
505 res_attr->private = &pdev->resource[i]; 504 res_attr->private = &pdev->resource[i];
@@ -582,7 +581,6 @@ static struct bin_attribute pci_config_attr = {
582 .attr = { 581 .attr = {
583 .name = "config", 582 .name = "config",
584 .mode = S_IRUGO | S_IWUSR, 583 .mode = S_IRUGO | S_IWUSR,
585 .owner = THIS_MODULE,
586 }, 584 },
587 .size = 256, 585 .size = 256,
588 .read = pci_read_config, 586 .read = pci_read_config,
@@ -593,7 +591,6 @@ static struct bin_attribute pcie_config_attr = {
593 .attr = { 591 .attr = {
594 .name = "config", 592 .name = "config",
595 .mode = S_IRUGO | S_IWUSR, 593 .mode = S_IRUGO | S_IWUSR,
596 .owner = THIS_MODULE,
597 }, 594 },
598 .size = 4096, 595 .size = 4096,
599 .read = pci_read_config, 596 .read = pci_read_config,
@@ -628,7 +625,6 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
628 rom_attr->size = pci_resource_len(pdev, PCI_ROM_RESOURCE); 625 rom_attr->size = pci_resource_len(pdev, PCI_ROM_RESOURCE);
629 rom_attr->attr.name = "rom"; 626 rom_attr->attr.name = "rom";
630 rom_attr->attr.mode = S_IRUSR; 627 rom_attr->attr.mode = S_IRUSR;
631 rom_attr->attr.owner = THIS_MODULE;
632 rom_attr->read = pci_read_rom; 628 rom_attr->read = pci_read_rom;
633 rom_attr->write = pci_write_rom; 629 rom_attr->write = pci_write_rom;
634 retval = sysfs_create_bin_file(&pdev->dev.kobj, rom_attr); 630 retval = sysfs_create_bin_file(&pdev->dev.kobj, rom_attr);