From: "Krzysztof Wilczyński" <kw@linux.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Pali Rohár" <pali@kernel.org>,
"Oliver O'Halloran" <oohall@gmail.com>,
"Krzysztof Hałasa" <khalasa@piap.pl>,
linux-pci@vger.kernel.org
Subject: [PATCH v2 6/7] PCI/sysfs: Rename pci_read_resource_io() and pci_write_resource_io()
Date: Fri, 10 Sep 2021 20:26:22 +0000 [thread overview]
Message-ID: <20210910202623.2293708-7-kw@linux.com> (raw)
In-Reply-To: <20210910202623.2293708-1-kw@linux.com>
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@linux.com>
---
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
next prev parent reply other threads:[~2021-09-10 20:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-10 20:26 [PATCH v2 0/7] PCI: Convert dynamic PCI resources sysfs objects into static Krzysztof Wilczyński
2021-09-10 20:26 ` [PATCH v2 1/7] PCI/sysfs: Add pci_dev_resource_attr_is_visible() helper Krzysztof Wilczyński
2021-09-10 20:26 ` [PATCH v2 2/7] PCI/sysfs: Add pci_dev_resource_attr() macro Krzysztof Wilczyński
2021-09-10 20:26 ` [PATCH v2 3/7] PCI/sysfs: Only allow IORESOURCE_IO in pci_resource_io() Krzysztof Wilczyński
2021-09-10 20:26 ` [PATCH v2 4/7] PCI/sysfs: Only allow supported resource type in pci_mmap_resource() Krzysztof Wilczyński
2021-09-10 20:26 ` [PATCH v2 5/7] PCI/sysfs: Convert PCI resource files to static attributes Krzysztof Wilczyński
2021-09-10 20:26 ` Krzysztof Wilczyński [this message]
2021-09-10 20:26 ` [PATCH v2 7/7] PCI/sysfs: Update code to match the preferred style Krzysztof Wilczyński
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210910202623.2293708-7-kw@linux.com \
--to=kw@linux.com \
--cc=bhelgaas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=khalasa@piap.pl \
--cc=linux-pci@vger.kernel.org \
--cc=oohall@gmail.com \
--cc=pali@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.