From: Heiner Kallweit <hkallweit1@gmail.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: [PATCH 1/3] PCI/VPD: Change pci_vpd_init return type to void
Date: Thu, 1 Apr 2021 18:37:47 +0200 [thread overview]
Message-ID: <663ec440-8375-1459-ddb4-98ea76e75917@gmail.com> (raw)
In-Reply-To: <1a0155ce-6c20-b653-d319-58e6505a1a40@gmail.com>
pci_init_capabilities() is the only caller and doesn't use the return
value. So let's change the return type to void.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/pci/pci.h | 2 +-
drivers/pci/vpd.c | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index bbbc55965..ff0f4aeef 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -141,7 +141,7 @@ static inline bool pcie_downstream_port(const struct pci_dev *dev)
type == PCI_EXP_TYPE_PCIE_BRIDGE;
}
-int pci_vpd_init(struct pci_dev *dev);
+void pci_vpd_init(struct pci_dev *dev);
void pci_vpd_release(struct pci_dev *dev);
/* PCI Virtual Channel */
diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
index 48f4a9ae8..85889718a 100644
--- a/drivers/pci/vpd.c
+++ b/drivers/pci/vpd.c
@@ -337,18 +337,18 @@ static const struct pci_vpd_ops pci_vpd_f0_ops = {
.write = pci_vpd_f0_write,
};
-int pci_vpd_init(struct pci_dev *dev)
+void pci_vpd_init(struct pci_dev *dev)
{
struct pci_vpd *vpd;
u8 cap;
cap = pci_find_capability(dev, PCI_CAP_ID_VPD);
if (!cap)
- return -ENODEV;
+ return;
vpd = kzalloc(sizeof(*vpd), GFP_ATOMIC);
if (!vpd)
- return -ENOMEM;
+ return;
vpd->len = PCI_VPD_MAX_SIZE;
if (dev->dev_flags & PCI_DEV_FLAGS_VPD_REF_F0)
@@ -360,7 +360,6 @@ int pci_vpd_init(struct pci_dev *dev)
vpd->busy = 0;
vpd->valid = 0;
dev->vpd = vpd;
- return 0;
}
void pci_vpd_release(struct pci_dev *dev)
--
2.31.1
next prev parent reply other threads:[~2021-04-01 18:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-01 16:35 [PATCH 0/3] PCI/VPD: Some improvements Heiner Kallweit
2021-04-01 16:37 ` Heiner Kallweit [this message]
2021-04-01 16:43 ` [PATCH 2/3] PCI/VPD: Remove argument off from pci_vpd_find_tag Heiner Kallweit
2021-04-01 16:44 ` [PATCH 3/3] PCI/VPD: Improve and simplify pci_vpd_find_tag Heiner Kallweit
2021-04-01 16:48 ` [PATCH 0/3] PCI/VPD: Some improvements Heiner Kallweit
2021-04-16 19:14 ` Bjorn Helgaas
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=663ec440-8375-1459-ddb4-98ea76e75917@gmail.com \
--to=hkallweit1@gmail.com \
--cc=bhelgaas@google.com \
--cc=linux-pci@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).