Commit 07b4523e authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

PCI/sysfs: Rename "vpd" attribute accessors

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: default avatarBjorn Helgaas <bhelgaas@google.com>
parent f42c35ea
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -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);