aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pcie
diff options
context:
space:
mode:
authorPrarit Bhargava <prarit@redhat.com>2013-03-20 12:04:43 +0000
committerBjorn Helgaas <bhelgaas@google.com>2013-04-03 17:08:45 -0600
commite82b14bdd390c534750a191f9936f842bab255d4 (patch)
tree532b2a09ba445b84232d5674a1043121427b9325 /drivers/pci/pcie
parentLinux 3.9-rc2 (diff)
downloadlinux-dev-e82b14bdd390c534750a191f9936f842bab255d4.tar.xz
linux-dev-e82b14bdd390c534750a191f9936f842bab255d4.zip
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>
Diffstat (limited to 'drivers/pci/pcie')
-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)
return -ENODEV;
rpdev = pcie_find_root_port(dev);
if (!rpdev) {
- ret = -ENOTTY;
+ ret = -ENODEV;
goto out_put;
}
pos_cap_err = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
if (!pos_cap_err) {
- ret = -ENOTTY;
+ ret = -EPERM;
goto out_put;
}
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)
rp_pos_cap_err = pci_find_ext_capability(rpdev, PCI_EXT_CAP_ID_ERR);
if (!rp_pos_cap_err) {
- ret = -ENOTTY;
+ ret = -EPERM;
goto out_put;
}