aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci-sysfs.c')
-rw-r--r--drivers/pci/pci-sysfs.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index c5df94e86678..997668558e79 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -75,7 +75,8 @@ static ssize_t local_cpus_show(struct device *dev,
75 int len; 75 int len;
76 76
77#ifdef CONFIG_NUMA 77#ifdef CONFIG_NUMA
78 mask = cpumask_of_node(dev_to_node(dev)); 78 mask = (dev_to_node(dev) == -1) ? cpu_online_mask :
79 cpumask_of_node(dev_to_node(dev));
79#else 80#else
80 mask = cpumask_of_pcibus(to_pci_dev(dev)->bus); 81 mask = cpumask_of_pcibus(to_pci_dev(dev)->bus);
81#endif 82#endif
@@ -93,7 +94,8 @@ static ssize_t local_cpulist_show(struct device *dev,
93 int len; 94 int len;
94 95
95#ifdef CONFIG_NUMA 96#ifdef CONFIG_NUMA
96 mask = cpumask_of_node(dev_to_node(dev)); 97 mask = (dev_to_node(dev) == -1) ? cpu_online_mask :
98 cpumask_of_node(dev_to_node(dev));
97#else 99#else
98 mask = cpumask_of_pcibus(to_pci_dev(dev)->bus); 100 mask = cpumask_of_pcibus(to_pci_dev(dev)->bus);
99#endif 101#endif
@@ -640,6 +642,7 @@ void pci_create_legacy_files(struct pci_bus *b)
640 if (!b->legacy_io) 642 if (!b->legacy_io)
641 goto kzalloc_err; 643 goto kzalloc_err;
642 644
645 sysfs_bin_attr_init(b->legacy_io);
643 b->legacy_io->attr.name = "legacy_io"; 646 b->legacy_io->attr.name = "legacy_io";
644 b->legacy_io->size = 0xffff; 647 b->legacy_io->size = 0xffff;
645 b->legacy_io->attr.mode = S_IRUSR | S_IWUSR; 648 b->legacy_io->attr.mode = S_IRUSR | S_IWUSR;
@@ -653,6 +656,7 @@ void pci_create_legacy_files(struct pci_bus *b)
653 656
654 /* Allocated above after the legacy_io struct */ 657 /* Allocated above after the legacy_io struct */
655 b->legacy_mem = b->legacy_io + 1; 658 b->legacy_mem = b->legacy_io + 1;
659 sysfs_bin_attr_init(b->legacy_mem);
656 b->legacy_mem->attr.name = "legacy_mem"; 660 b->legacy_mem->attr.name = "legacy_mem";
657 b->legacy_mem->size = 1024*1024; 661 b->legacy_mem->size = 1024*1024;
658 b->legacy_mem->attr.mode = S_IRUSR | S_IWUSR; 662 b->legacy_mem->attr.mode = S_IRUSR | S_IWUSR;
@@ -798,6 +802,7 @@ static int pci_create_attr(struct pci_dev *pdev, int num, int write_combine)
798 if (res_attr) { 802 if (res_attr) {
799 char *res_attr_name = (char *)(res_attr + 1); 803 char *res_attr_name = (char *)(res_attr + 1);
800 804
805 sysfs_bin_attr_init(res_attr);
801 if (write_combine) { 806 if (write_combine) {
802 pdev->res_attr_wc[num] = res_attr; 807 pdev->res_attr_wc[num] = res_attr;
803 sprintf(res_attr_name, "resource%d_wc", num); 808 sprintf(res_attr_name, "resource%d_wc", num);
@@ -970,6 +975,7 @@ static int pci_create_capabilities_sysfs(struct pci_dev *dev)
970 if (!attr) 975 if (!attr)
971 return -ENOMEM; 976 return -ENOMEM;
972 977
978 sysfs_bin_attr_init(attr);
973 attr->size = dev->vpd->len; 979 attr->size = dev->vpd->len;
974 attr->attr.name = "vpd"; 980 attr->attr.name = "vpd";
975 attr->attr.mode = S_IRUSR | S_IWUSR; 981 attr->attr.mode = S_IRUSR | S_IWUSR;
@@ -1036,6 +1042,7 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
1036 retval = -ENOMEM; 1042 retval = -ENOMEM;
1037 goto err_resource_files; 1043 goto err_resource_files;
1038 } 1044 }
1045 sysfs_bin_attr_init(attr);
1039 attr->size = rom_size; 1046 attr->size = rom_size;
1040 attr->attr.name = "rom"; 1047 attr->attr.name = "rom";
1041 attr->attr.mode = S_IRUSR; 1048 attr->attr.mode = S_IRUSR;