]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/pci/pci-sysfs.c
Merge tag 'trace-v5.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[linux.git] / drivers / pci / pci-sysfs.c
index 7934129545290480b573f03976e8d5e5e220ef01..13f766db0684e61c522298a1cd3dbfbd31634452 100644 (file)
@@ -1122,7 +1122,7 @@ static void pci_remove_resource_files(struct pci_dev *pdev)
 {
        int i;
 
-       for (i = 0; i < PCI_ROM_RESOURCE; i++) {
+       for (i = 0; i < PCI_STD_NUM_BARS; i++) {
                struct bin_attribute *res_attr;
 
                res_attr = pdev->res_attr[i];
@@ -1193,7 +1193,7 @@ static int pci_create_resource_files(struct pci_dev *pdev)
        int retval;
 
        /* Expose the PCI resources from this device as files */
-       for (i = 0; i < PCI_ROM_RESOURCE; i++) {
+       for (i = 0; i < PCI_STD_NUM_BARS; i++) {
 
                /* skip empty resources */
                if (!pci_resource_len(pdev, i))
@@ -1330,7 +1330,6 @@ static int pci_create_capabilities_sysfs(struct pci_dev *dev)
        int retval;
 
        pcie_vpd_create_sysfs_dev_files(dev);
-       pcie_aspm_create_sysfs_dev_files(dev);
 
        if (dev->reset_fn) {
                retval = device_create_file(&dev->dev, &dev_attr_reset);
@@ -1340,7 +1339,6 @@ static int pci_create_capabilities_sysfs(struct pci_dev *dev)
        return 0;
 
 error:
-       pcie_aspm_remove_sysfs_dev_files(dev);
        pcie_vpd_remove_sysfs_dev_files(dev);
        return retval;
 }
@@ -1416,7 +1414,6 @@ int __must_check pci_create_sysfs_dev_files(struct pci_dev *pdev)
 static void pci_remove_capabilities_sysfs(struct pci_dev *dev)
 {
        pcie_vpd_remove_sysfs_dev_files(dev);
-       pcie_aspm_remove_sysfs_dev_files(dev);
        if (dev->reset_fn) {
                device_remove_file(&dev->dev, &dev_attr_reset);
                dev->reset_fn = 0;
@@ -1539,24 +1536,6 @@ const struct attribute_group *pci_dev_groups[] = {
        NULL,
 };
 
-static const struct attribute_group pci_bridge_group = {
-       .attrs = pci_bridge_attrs,
-};
-
-const struct attribute_group *pci_bridge_groups[] = {
-       &pci_bridge_group,
-       NULL,
-};
-
-static const struct attribute_group pcie_dev_group = {
-       .attrs = pcie_dev_attrs,
-};
-
-const struct attribute_group *pcie_dev_groups[] = {
-       &pcie_dev_group,
-       NULL,
-};
-
 static const struct attribute_group pci_dev_hp_attr_group = {
        .attrs = pci_dev_hp_attrs,
        .is_visible = pci_dev_hp_attrs_are_visible,
@@ -1587,6 +1566,9 @@ static const struct attribute_group *pci_dev_attr_groups[] = {
        &pcie_dev_attr_group,
 #ifdef CONFIG_PCIEAER
        &aer_stats_attr_group,
+#endif
+#ifdef CONFIG_PCIEASPM
+       &aspm_ctrl_attr_group,
 #endif
        NULL,
 };