PCI/sysfs: Rename "vpd" attribute accessors
authorBjorn Helgaas <bhelgaas@google.com>
Wed, 28 Apr 2021 18:32:53 +0000 (13:32 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 29 Apr 2021 15:07:17 +0000 (10:07 -0500)
Rename "vpd" attribute accessors so they fit with the BIN_ATTR_RW() macro
usage.  Currently there is no BIN_ATTR_ADMIN_RW() that uses 0600
permissions, but if there were, it would likely use "vpd_read()" and
"vpd_write()".  No functional change intended.

Extracted from the patch mentioned below by Heiner Kallweit
<hkallweit1@gmail.com>.

Link: https://lore.kernel.org/linux-pci/7703024f-8882-9eec-a122-599871728a89@gmail.com/
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/vpd.c

index 7915d10..874bc15 100644 (file)
@@ -397,9 +397,9 @@ void pci_vpd_release(struct pci_dev *dev)
        kfree(dev->vpd);
 }
 
-static ssize_t read_vpd_attr(struct file *filp, struct kobject *kobj,
-                            struct bin_attribute *bin_attr, char *buf,
-                            loff_t off, size_t count)
+static ssize_t vpd_read(struct file *filp, struct kobject *kobj,
+                       struct bin_attribute *bin_attr, char *buf, loff_t off,
+                       size_t count)
 {
        struct pci_dev *dev = to_pci_dev(kobj_to_dev(kobj));
 
@@ -413,9 +413,9 @@ static ssize_t read_vpd_attr(struct file *filp, struct kobject *kobj,
        return pci_read_vpd(dev, off, count, buf);
 }
 
-static ssize_t write_vpd_attr(struct file *filp, struct kobject *kobj,
-                             struct bin_attribute *bin_attr, char *buf,
-                             loff_t off, size_t count)
+static ssize_t vpd_write(struct file *filp, struct kobject *kobj,
+                        struct bin_attribute *bin_attr, char *buf, loff_t off,
+                        size_t count)
 {
        struct pci_dev *dev = to_pci_dev(kobj_to_dev(kobj));
 
@@ -445,8 +445,8 @@ void pcie_vpd_create_sysfs_dev_files(struct pci_dev *dev)
        attr->size = 0;
        attr->attr.name = "vpd";
        attr->attr.mode = S_IRUSR | S_IWUSR;
-       attr->read = read_vpd_attr;
-       attr->write = write_vpd_attr;
+       attr->read = vpd_read;
+       attr->write = vpd_write;
        retval = sysfs_create_bin_file(&dev->dev.kobj, attr);
        if (retval) {
                kfree(attr);