aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2014-05-21 01:23:30 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-05-27 19:10:16 -0400
commitd97ffe236894856d08146390ef3fbe6448a8ac2b (patch)
tree0935d466ca429a5b61a9b82ed44a6c623175964f /include/linux/pci.h
parenta43ae58c848cfbadaba81c8d63202b4487f922a0 (diff)
PCI: Fix return value from pci_user_{read,write}_config_*()
The PCI user-space config accessors pci_user_{read,write}_config_*() return negative error numbers, which were introduced by commit 34e3207205ef ("PCI: handle positive error codes"). That patch converted all positive error numbers from platform-specific PCI config accessors to -EINVAL, which means the callers don't know anything about the specific cause of the failure. The patch fixes the issue by converting the positive PCIBIOS_* error values to generic negative error numbers with pcibios_err_to_errno(). [bhelgaas: changelog] Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Greg Thelen <gthelen@google.com>
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 018877b8b4e8..322335aaa7e1 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -518,7 +518,7 @@ static inline int pcibios_err_to_errno(int err)
518 case PCIBIOS_FUNC_NOT_SUPPORTED: 518 case PCIBIOS_FUNC_NOT_SUPPORTED:
519 return -ENOENT; 519 return -ENOENT;
520 case PCIBIOS_BAD_VENDOR_ID: 520 case PCIBIOS_BAD_VENDOR_ID:
521 return -EINVAL; 521 return -ENOTTY;
522 case PCIBIOS_DEVICE_NOT_FOUND: 522 case PCIBIOS_DEVICE_NOT_FOUND:
523 return -ENODEV; 523 return -ENODEV;
524 case PCIBIOS_BAD_REGISTER_NUMBER: 524 case PCIBIOS_BAD_REGISTER_NUMBER:
@@ -529,7 +529,7 @@ static inline int pcibios_err_to_errno(int err)
529 return -ENOSPC; 529 return -ENOSPC;
530 } 530 }
531 531
532 return -ENOTTY; 532 return -ERANGE;
533} 533}
534 534
535/* Low-level architecture-dependent routines */ 535/* Low-level architecture-dependent routines */