Merge branch 'pci/vpd'
authorBjorn Helgaas <bhelgaas@google.com>
Wed, 4 Apr 2018 18:28:40 +0000 (13:28 -0500)
committerBjorn Helgaas <helgaas@kernel.org>
Wed, 4 Apr 2018 18:28:40 +0000 (13:28 -0500)
  - consolidate VPD code in vpd.c (Bjorn Helgaas)

* pci/vpd:
  PCI/VPD: Move VPD structures to vpd.c
  PCI/VPD: Move VPD quirks to vpd.c
  PCI/VPD: Move VPD sysfs code to vpd.c
  PCI/VPD: Move VPD access code to vpd.c

1  2 
drivers/pci/access.c
drivers/pci/pci-sysfs.c
drivers/pci/pci.h
drivers/pci/quirks.c
drivers/pci/vpd.c

Simple merge
@@@ -1490,32 -1485,11 +1458,11 @@@ static struct device_attribute reset_at
  static int pci_create_capabilities_sysfs(struct pci_dev *dev)
  {
        int retval;
-       struct bin_attribute *attr;
-       /* If the device has VPD, try to expose it in sysfs. */
-       if (dev->vpd) {
-               attr = kzalloc(sizeof(*attr), GFP_ATOMIC);
-               if (!attr)
-                       return -ENOMEM;
  
-               sysfs_bin_attr_init(attr);
-               attr->size = 0;
-               attr->attr.name = "vpd";
-               attr->attr.mode = S_IRUSR | S_IWUSR;
-               attr->read = read_vpd_attr;
-               attr->write = write_vpd_attr;
-               retval = sysfs_create_bin_file(&dev->dev.kobj, attr);
-               if (retval) {
-                       kfree(attr);
-                       return retval;
-               }
-               dev->vpd->attr = attr;
-       }
-       /* Active State Power Management */
+       pcie_vpd_create_sysfs_dev_files(dev);
        pcie_aspm_create_sysfs_dev_files(dev);
  
 -      if (!pci_probe_reset_function(dev)) {
 +      if (dev->reset_fn) {
                retval = device_create_file(&dev->dev, &reset_attr);
                if (retval)
                        goto error;
Simple merge
Simple merge
Simple merge