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.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 8568b207f189..6ca0061137a6 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -73,6 +73,17 @@ resource_show(struct device * dev, char * buf)
73 return (str - buf); 73 return (str - buf);
74} 74}
75 75
76static ssize_t modalias_show(struct device *dev, char *buf)
77{
78 struct pci_dev *pci_dev = to_pci_dev(dev);
79
80 return sprintf(buf, "pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02x\n",
81 pci_dev->vendor, pci_dev->device,
82 pci_dev->subsystem_vendor, pci_dev->subsystem_device,
83 (u8)(pci_dev->class >> 16), (u8)(pci_dev->class >> 8),
84 (u8)(pci_dev->class));
85}
86
76struct device_attribute pci_dev_attrs[] = { 87struct device_attribute pci_dev_attrs[] = {
77 __ATTR_RO(resource), 88 __ATTR_RO(resource),
78 __ATTR_RO(vendor), 89 __ATTR_RO(vendor),
@@ -82,6 +93,7 @@ struct device_attribute pci_dev_attrs[] = {
82 __ATTR_RO(class), 93 __ATTR_RO(class),
83 __ATTR_RO(irq), 94 __ATTR_RO(irq),
84 __ATTR_RO(local_cpus), 95 __ATTR_RO(local_cpus),
96 __ATTR_RO(modalias),
85 __ATTR_NULL, 97 __ATTR_NULL,
86}; 98};
87 99