diff options
-rw-r--r-- | arch/microblaze/pci/pci-common.c | 20 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 20 | ||||
-rw-r--r-- | drivers/pci/pci-sysfs.c | 18 |
3 files changed, 18 insertions, 40 deletions
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 70996cc66aa2..a59de1bc1ce0 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c | |||
@@ -168,26 +168,6 @@ struct pci_controller *pci_find_hose_for_OF_device(struct device_node *node) | |||
168 | return NULL; | 168 | return NULL; |
169 | } | 169 | } |
170 | 170 | ||
171 | static ssize_t pci_show_devspec(struct device *dev, | ||
172 | struct device_attribute *attr, char *buf) | ||
173 | { | ||
174 | struct pci_dev *pdev; | ||
175 | struct device_node *np; | ||
176 | |||
177 | pdev = to_pci_dev(dev); | ||
178 | np = pci_device_to_OF_node(pdev); | ||
179 | if (np == NULL || np->full_name == NULL) | ||
180 | return 0; | ||
181 | return sprintf(buf, "%s", np->full_name); | ||
182 | } | ||
183 | static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL); | ||
184 | |||
185 | /* Add sysfs properties */ | ||
186 | int pcibios_add_platform_entries(struct pci_dev *pdev) | ||
187 | { | ||
188 | return device_create_file(&pdev->dev, &dev_attr_devspec); | ||
189 | } | ||
190 | |||
191 | void pcibios_set_master(struct pci_dev *dev) | 171 | void pcibios_set_master(struct pci_dev *dev) |
192 | { | 172 | { |
193 | /* No special bus mastering setup handling */ | 173 | /* No special bus mastering setup handling */ |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index d9476c1fc959..24d342e91790 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -201,26 +201,6 @@ struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node) | |||
201 | return NULL; | 201 | return NULL; |
202 | } | 202 | } |
203 | 203 | ||
204 | static ssize_t pci_show_devspec(struct device *dev, | ||
205 | struct device_attribute *attr, char *buf) | ||
206 | { | ||
207 | struct pci_dev *pdev; | ||
208 | struct device_node *np; | ||
209 | |||
210 | pdev = to_pci_dev (dev); | ||
211 | np = pci_device_to_OF_node(pdev); | ||
212 | if (np == NULL || np->full_name == NULL) | ||
213 | return 0; | ||
214 | return sprintf(buf, "%s", np->full_name); | ||
215 | } | ||
216 | static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL); | ||
217 | |||
218 | /* Add sysfs properties */ | ||
219 | int pcibios_add_platform_entries(struct pci_dev *pdev) | ||
220 | { | ||
221 | return device_create_file(&pdev->dev, &dev_attr_devspec); | ||
222 | } | ||
223 | |||
224 | /* | 204 | /* |
225 | * Reads the interrupt pin to determine if interrupt is use by card. | 205 | * Reads the interrupt pin to determine if interrupt is use by card. |
226 | * If the interrupt is used, then gets the interrupt line from the | 206 | * If the interrupt is used, then gets the interrupt line from the |
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 4e0acefb7565..3db1c7ff5dd3 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/vgaarb.h> | 30 | #include <linux/vgaarb.h> |
31 | #include <linux/pm_runtime.h> | 31 | #include <linux/pm_runtime.h> |
32 | #include <linux/of.h> | ||
32 | #include "pci.h" | 33 | #include "pci.h" |
33 | 34 | ||
34 | static int sysfs_initialized; /* = 0 */ | 35 | static int sysfs_initialized; /* = 0 */ |
@@ -416,6 +417,20 @@ static ssize_t d3cold_allowed_show(struct device *dev, | |||
416 | static DEVICE_ATTR_RW(d3cold_allowed); | 417 | static DEVICE_ATTR_RW(d3cold_allowed); |
417 | #endif | 418 | #endif |
418 | 419 | ||
420 | #ifdef CONFIG_OF | ||
421 | static ssize_t devspec_show(struct device *dev, | ||
422 | struct device_attribute *attr, char *buf) | ||
423 | { | ||
424 | struct pci_dev *pdev = to_pci_dev(dev); | ||
425 | struct device_node *np = pci_device_to_OF_node(pdev); | ||
426 | |||
427 | if (np == NULL || np->full_name == NULL) | ||
428 | return 0; | ||
429 | return sprintf(buf, "%s", np->full_name); | ||
430 | } | ||
431 | static DEVICE_ATTR_RO(devspec); | ||
432 | #endif | ||
433 | |||
419 | #ifdef CONFIG_PCI_IOV | 434 | #ifdef CONFIG_PCI_IOV |
420 | static ssize_t sriov_totalvfs_show(struct device *dev, | 435 | static ssize_t sriov_totalvfs_show(struct device *dev, |
421 | struct device_attribute *attr, | 436 | struct device_attribute *attr, |
@@ -521,6 +536,9 @@ static struct attribute *pci_dev_attrs[] = { | |||
521 | #if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI) | 536 | #if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI) |
522 | &dev_attr_d3cold_allowed.attr, | 537 | &dev_attr_d3cold_allowed.attr, |
523 | #endif | 538 | #endif |
539 | #ifdef CONFIG_OF | ||
540 | &dev_attr_devspec.attr, | ||
541 | #endif | ||
524 | NULL, | 542 | NULL, |
525 | }; | 543 | }; |
526 | 544 | ||