diff options
author | Andrew Patterson <andrew.patterson@hp.com> | 2009-10-12 15:14:10 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-11-04 16:06:38 -0500 |
commit | 1d0243559497b9cab00099c49a5ba3222cd6576f (patch) | |
tree | 36a0e7707770e5f97df28aa8ec0a92b7307d16aa /drivers/pci/pcie/aer | |
parent | cc5d153a0ca794e3781ef34c76f32ad3e991b13d (diff) |
PCI: use better error return values in aer_inject
Replaced some error return values in aer_inject. Use -ENODEV when we
can't find a device and -ENOTTY when the device does not support PCIe AER.
Acked-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pcie/aer')
-rw-r--r-- | drivers/pci/pcie/aer/aer_inject.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pci/pcie/aer/aer_inject.c b/drivers/pci/pcie/aer/aer_inject.c index ac0b5e7bb3f5..da2ad6eaee17 100644 --- a/drivers/pci/pcie/aer/aer_inject.c +++ b/drivers/pci/pcie/aer/aer_inject.c | |||
@@ -326,23 +326,23 @@ static int aer_inject(struct aer_error_inj *einj) | |||
326 | 326 | ||
327 | dev = pci_get_domain_bus_and_slot((int)einj->domain, einj->bus, devfn); | 327 | dev = pci_get_domain_bus_and_slot((int)einj->domain, einj->bus, devfn); |
328 | if (!dev) | 328 | if (!dev) |
329 | return -EINVAL; | 329 | return -ENODEV; |
330 | rpdev = pcie_find_root_port(dev); | 330 | rpdev = pcie_find_root_port(dev); |
331 | if (!rpdev) { | 331 | if (!rpdev) { |
332 | ret = -EINVAL; | 332 | ret = -ENOTTY; |
333 | goto out_put; | 333 | goto out_put; |
334 | } | 334 | } |
335 | 335 | ||
336 | pos_cap_err = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); | 336 | pos_cap_err = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); |
337 | if (!pos_cap_err) { | 337 | if (!pos_cap_err) { |
338 | ret = -EIO; | 338 | ret = -ENOTTY; |
339 | goto out_put; | 339 | goto out_put; |
340 | } | 340 | } |
341 | pci_read_config_dword(dev, pos_cap_err + PCI_ERR_UNCOR_SEVER, &sever); | 341 | pci_read_config_dword(dev, pos_cap_err + PCI_ERR_UNCOR_SEVER, &sever); |
342 | 342 | ||
343 | rp_pos_cap_err = pci_find_ext_capability(rpdev, PCI_EXT_CAP_ID_ERR); | 343 | rp_pos_cap_err = pci_find_ext_capability(rpdev, PCI_EXT_CAP_ID_ERR); |
344 | if (!rp_pos_cap_err) { | 344 | if (!rp_pos_cap_err) { |
345 | ret = -EIO; | 345 | ret = -ENOTTY; |
346 | goto out_put; | 346 | goto out_put; |
347 | } | 347 | } |
348 | 348 | ||