]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
PCI: make CPU list affinity visible
authorMike Travis <travis@sgi.com>
Sat, 6 Sep 2008 12:46:42 +0000 (05:46 -0700)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Mon, 20 Oct 2008 17:53:51 +0000 (10:53 -0700)
Stephen Hemminger wrote:
> Looks like Mike created cpulistaffinty in sysfs but never completed
> the job.

This patch hooks things up correctly, taking care to remove the new file
when the bus is destroyed.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/bus.c
drivers/pci/pci.h
drivers/pci/remove.c

index 529d9d7727b01d1ea857388cb0514f2703c8f5b3..999cc4088b5952beb76e018e573afff4b53fba04 100644 (file)
@@ -151,6 +151,13 @@ void pci_bus_add_devices(struct pci_bus *bus)
                        if (retval)
                                dev_err(&dev->dev, "Error creating cpuaffinity"
                                        " file, continuing...\n");
+
+                       retval = device_create_file(&child_bus->dev,
+                                               &dev_attr_cpulistaffinity);
+                       if (retval)
+                               dev_err(&dev->dev,
+                                       "Error creating cpulistaffinity"
+                                       " file, continuing...\n");
                }
        }
 }
index d807cd786f20a18419105df88d8cf816019cab48..4723b12fb39a8e9a22c7e33a28b0df4efb5ef1eb 100644 (file)
@@ -109,6 +109,7 @@ static inline int pci_no_d1d2(struct pci_dev *dev)
 extern int pcie_mch_quirk;
 extern struct device_attribute pci_dev_attrs[];
 extern struct device_attribute dev_attr_cpuaffinity;
+extern struct device_attribute dev_attr_cpulistaffinity;
 
 /**
  * pci_match_one_device - Tell if a PCI device structure has a matching
index bdc2a44d68e1dbc4859c7d1628a24411ca0802ee..f94f6d5ae2971e6828ed5ad90dad4c0901737d1f 100644 (file)
@@ -73,6 +73,7 @@ void pci_remove_bus(struct pci_bus *pci_bus)
        up_write(&pci_bus_sem);
        pci_remove_legacy_files(pci_bus);
        device_remove_file(&pci_bus->dev, &dev_attr_cpuaffinity);
+       device_remove_file(&pci_bus->dev, &dev_attr_cpulistaffinity);
        device_unregister(&pci_bus->dev);
 }
 EXPORT_SYMBOL(pci_remove_bus);