[PATCH v2 6/7] PCI/sysfs: Rename pci_read_resource_io() and pci_write_resource_io()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The pci_read_resource_io() and pci_write_resource_io() functions are
used for the corresponding read() and write() callbacks when declaring
and defining a static sysfs object for a given PCI resource.

Currently, only reading and writing against an I/O BARs is supported,
but we might change this in the future to also include memory-mapped
resources.

Thus, rename to read() and write() callbacks to be more generic and drop
the I/O BARs-specific suffix from them.

Signed-off-by: Krzysztof Wilczyński <kw@xxxxxxxxx>
---
 drivers/pci/pci-sysfs.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 084c386c94c4..17535f4028af 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -1122,16 +1122,16 @@ static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj,
 	return -EINVAL;
 }
 
-static ssize_t pci_read_resource_io(struct file *filp, struct kobject *kobj,
-				    struct bin_attribute *attr, char *buf,
-				    loff_t off, size_t count)
+static ssize_t pci_read_resource(struct file *filp, struct kobject *kobj,
+				 struct bin_attribute *attr, char *buf,
+				 loff_t off, size_t count)
 {
 	return pci_resource_io(filp, kobj, attr, buf, off, count, false);
 }
 
-static ssize_t pci_write_resource_io(struct file *filp, struct kobject *kobj,
-				     struct bin_attribute *attr, char *buf,
-				     loff_t off, size_t count)
+static ssize_t pci_write_resource(struct file *filp, struct kobject *kobj,
+				  struct bin_attribute *attr, char *buf,
+				  loff_t off, size_t count)
 {
 	int ret;
 
@@ -1168,8 +1168,8 @@ static umode_t pci_dev_resource_attr_is_visible(struct kobject *kobj,
 #define pci_dev_bin_attribute(_name, _mmap, _bar)		\
 struct bin_attribute pci_dev_##_name##_attr = {			\
 	.attr = { .name = __stringify(_name), .mode = 0600 },	\
-	.read = pci_read_resource_io,				\
-	.write = pci_write_resource_io,				\
+	.read = pci_read_resource,				\
+	.write = pci_write_resource,				\
 	.mmap = _mmap,						\
 	.private = (void *)(unsigned long)_bar,			\
 	.f_mapping = iomem_get_mapping,				\
-- 
2.33.0




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux