diff options
Diffstat (limited to 'drivers/pci/pci-sysfs.c')
-rw-r--r-- | drivers/pci/pci-sysfs.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 2f3780b50723..1eecfa301f7f 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
@@ -556,9 +556,9 @@ static ssize_t devspec_show(struct device *dev, | |||
556 | struct pci_dev *pdev = to_pci_dev(dev); | 556 | struct pci_dev *pdev = to_pci_dev(dev); |
557 | struct device_node *np = pci_device_to_OF_node(pdev); | 557 | struct device_node *np = pci_device_to_OF_node(pdev); |
558 | 558 | ||
559 | if (np == NULL || np->full_name == NULL) | 559 | if (np == NULL) |
560 | return 0; | 560 | return 0; |
561 | return sprintf(buf, "%s", np->full_name); | 561 | return sprintf(buf, "%pOF", np); |
562 | } | 562 | } |
563 | static DEVICE_ATTR_RO(devspec); | 563 | static DEVICE_ATTR_RO(devspec); |
564 | #endif | 564 | #endif |
@@ -1211,11 +1211,8 @@ static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj, | |||
1211 | { | 1211 | { |
1212 | struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj)); | 1212 | struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj)); |
1213 | int bar = (unsigned long)attr->private; | 1213 | int bar = (unsigned long)attr->private; |
1214 | struct resource *res; | ||
1215 | unsigned long port = off; | 1214 | unsigned long port = off; |
1216 | 1215 | ||
1217 | res = &pdev->resource[bar]; | ||
1218 | |||
1219 | port += pci_resource_start(pdev, bar); | 1216 | port += pci_resource_start(pdev, bar); |
1220 | 1217 | ||
1221 | if (port > pci_resource_end(pdev, bar)) | 1218 | if (port > pci_resource_end(pdev, bar)) |
@@ -1431,7 +1428,7 @@ static ssize_t pci_read_rom(struct file *filp, struct kobject *kobj, | |||
1431 | return count; | 1428 | return count; |
1432 | } | 1429 | } |
1433 | 1430 | ||
1434 | static struct bin_attribute pci_config_attr = { | 1431 | static const struct bin_attribute pci_config_attr = { |
1435 | .attr = { | 1432 | .attr = { |
1436 | .name = "config", | 1433 | .name = "config", |
1437 | .mode = S_IRUGO | S_IWUSR, | 1434 | .mode = S_IRUGO | S_IWUSR, |
@@ -1441,7 +1438,7 @@ static struct bin_attribute pci_config_attr = { | |||
1441 | .write = pci_write_config, | 1438 | .write = pci_write_config, |
1442 | }; | 1439 | }; |
1443 | 1440 | ||
1444 | static struct bin_attribute pcie_config_attr = { | 1441 | static const struct bin_attribute pcie_config_attr = { |
1445 | .attr = { | 1442 | .attr = { |
1446 | .name = "config", | 1443 | .name = "config", |
1447 | .mode = S_IRUGO | S_IWUSR, | 1444 | .mode = S_IRUGO | S_IWUSR, |
@@ -1735,7 +1732,7 @@ const struct attribute_group *pcie_dev_groups[] = { | |||
1735 | NULL, | 1732 | NULL, |
1736 | }; | 1733 | }; |
1737 | 1734 | ||
1738 | static struct attribute_group pci_dev_hp_attr_group = { | 1735 | static const struct attribute_group pci_dev_hp_attr_group = { |
1739 | .attrs = pci_dev_hp_attrs, | 1736 | .attrs = pci_dev_hp_attrs, |
1740 | .is_visible = pci_dev_hp_attrs_are_visible, | 1737 | .is_visible = pci_dev_hp_attrs_are_visible, |
1741 | }; | 1738 | }; |
@@ -1759,23 +1756,23 @@ static umode_t sriov_attrs_are_visible(struct kobject *kobj, | |||
1759 | return a->mode; | 1756 | return a->mode; |
1760 | } | 1757 | } |
1761 | 1758 | ||
1762 | static struct attribute_group sriov_dev_attr_group = { | 1759 | static const struct attribute_group sriov_dev_attr_group = { |
1763 | .attrs = sriov_dev_attrs, | 1760 | .attrs = sriov_dev_attrs, |
1764 | .is_visible = sriov_attrs_are_visible, | 1761 | .is_visible = sriov_attrs_are_visible, |
1765 | }; | 1762 | }; |
1766 | #endif /* CONFIG_PCI_IOV */ | 1763 | #endif /* CONFIG_PCI_IOV */ |
1767 | 1764 | ||
1768 | static struct attribute_group pci_dev_attr_group = { | 1765 | static const struct attribute_group pci_dev_attr_group = { |
1769 | .attrs = pci_dev_dev_attrs, | 1766 | .attrs = pci_dev_dev_attrs, |
1770 | .is_visible = pci_dev_attrs_are_visible, | 1767 | .is_visible = pci_dev_attrs_are_visible, |
1771 | }; | 1768 | }; |
1772 | 1769 | ||
1773 | static struct attribute_group pci_bridge_attr_group = { | 1770 | static const struct attribute_group pci_bridge_attr_group = { |
1774 | .attrs = pci_bridge_attrs, | 1771 | .attrs = pci_bridge_attrs, |
1775 | .is_visible = pci_bridge_attrs_are_visible, | 1772 | .is_visible = pci_bridge_attrs_are_visible, |
1776 | }; | 1773 | }; |
1777 | 1774 | ||
1778 | static struct attribute_group pcie_dev_attr_group = { | 1775 | static const struct attribute_group pcie_dev_attr_group = { |
1779 | .attrs = pcie_dev_attrs, | 1776 | .attrs = pcie_dev_attrs, |
1780 | .is_visible = pcie_dev_attrs_are_visible, | 1777 | .is_visible = pcie_dev_attrs_are_visible, |
1781 | }; | 1778 | }; |