From: Bjorn Helgaas Date: Wed, 4 Apr 2018 18:28:40 +0000 (-0500) Subject: Merge branch 'pci/vpd' X-Git-Tag: v4.19~1271^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8afd5ef001b85034c31025686d3b7419103d729;p=platform%2Fkernel%2Flinux-rpi.git Merge branch 'pci/vpd' - 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 --- c8afd5ef001b85034c31025686d3b7419103d729 diff --cc drivers/pci/pci-sysfs.c index 116e97d,4415e624..366d93a --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@@ -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;