aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrarit Bhargava <prarit@redhat.com>2013-03-20 08:04:43 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-04-03 19:08:45 -0400
commite82b14bdd390c534750a191f9936f842bab255d4 (patch)
tree532b2a09ba445b84232d5674a1043121427b9325
parentf6161aa153581da4a3867a2d1a7caf4be19b6ec9 (diff)
PCI: aer_inject: Fix return values when device not found
Currently the aer_inject driver returns -ENOTTY when the target PCIe device root port is not found or if the device or root port doesn't support AER. In the case where the root port isn't found, the driver should return -ENODEV, and in the other cases it should return -EPERM. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r--drivers/pci/pcie/aer/aer_inject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/pcie/aer/aer_inject.c b/drivers/pci/pcie/aer/aer_inject.c
index 4e24cb8a94ae..8d4a5e3dbe8e 100644
--- a/drivers/pci/pcie/aer/aer_inject.c
+++ b/drivers/pci/pcie/aer/aer_inject.c
@@ -334,13 +334,13 @@ static int aer_inject(struct aer_error_inj *einj)
334 return -ENODEV; 334 return -ENODEV;
335 rpdev = pcie_find_root_port(dev); 335 rpdev = pcie_find_root_port(dev);
336 if (!rpdev) { 336 if (!rpdev) {
337 ret = -ENOTTY; 337 ret = -ENODEV;
338 goto out_put; 338 goto out_put;
339 } 339 }
340 340
341 pos_cap_err = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); 341 pos_cap_err = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
342 if (!pos_cap_err) { 342 if (!pos_cap_err) {
343 ret = -ENOTTY; 343 ret = -EPERM;
344 goto out_put; 344 goto out_put;
345 } 345 }
346 pci_read_config_dword(dev, pos_cap_err + PCI_ERR_UNCOR_SEVER, &sever); 346 pci_read_config_dword(dev, pos_cap_err + PCI_ERR_UNCOR_SEVER, &sever);
@@ -350,7 +350,7 @@ static int aer_inject(struct aer_error_inj *einj)
350 350
351 rp_pos_cap_err = pci_find_ext_capability(rpdev, PCI_EXT_CAP_ID_ERR); 351 rp_pos_cap_err = pci_find_ext_capability(rpdev, PCI_EXT_CAP_ID_ERR);
352 if (!rp_pos_cap_err) { 352 if (!rp_pos_cap_err) {
353 ret = -ENOTTY; 353 ret = -EPERM;
354 goto out_put; 354 goto out_put;
355 } 355 }
356 356