linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Replace -EINVAL with PCIBIOS_BAD_REGISTER_NUMBER
@ 2020-04-09 16:16 Bolarinwa Olayemi Saheed
  2020-04-10  1:28 ` Yicong Yang
  0 siblings, 1 reply; 7+ messages in thread
From: Bolarinwa Olayemi Saheed @ 2020-04-09 16:16 UTC (permalink / raw)
  To: helgaas; +Cc: Bolarinwa Olayemi Saheed, bjorn, skhan, linux-pci

Signed-off-by: Bolarinwa Olayemi Saheed <refactormyself@gmail.com>
Suggested-by: Bjorn Helgaas <bjorn@helgaas.com>
---
 drivers/pci/access.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/access.c b/drivers/pci/access.c
index 79c4a2ef269a..451f2b8b2b3c 100644
--- a/drivers/pci/access.c
+++ b/drivers/pci/access.c
@@ -409,7 +409,7 @@ int pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val)
 
 	*val = 0;
 	if (pos & 1)
-		return -EINVAL;
+		return PCIBIOS_BAD_REGISTER_NUMBER;
 
 	if (pcie_capability_reg_implemented(dev, pos)) {
 		ret = pci_read_config_word(dev, pci_pcie_cap(dev) + pos, val);
@@ -444,7 +444,7 @@ int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *val)
 
 	*val = 0;
 	if (pos & 3)
-		return -EINVAL;
+		return PCIBIOS_BAD_REGISTER_NUMBER;
 
 	if (pcie_capability_reg_implemented(dev, pos)) {
 		ret = pci_read_config_dword(dev, pci_pcie_cap(dev) + pos, val);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-24 15:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09 16:16 [PATCH] Replace -EINVAL with PCIBIOS_BAD_REGISTER_NUMBER Bolarinwa Olayemi Saheed
2020-04-10  1:28 ` Yicong Yang
2020-04-10 16:13   ` Saheed Bolarinwa
2020-04-10 20:22   ` Bjorn Helgaas
2020-04-11  2:10     ` Yicong Yang
2020-04-19  5:56       ` Saheed Bolarinwa
2020-04-24 15:17         ` Bjorn Helgaas

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).