PCI/AER: Fix aer_inject error codes
authorJean Delvare <jdelvare@suse.de>
Thu, 18 Feb 2016 12:50:45 +0000 (13:50 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 8 Mar 2016 21:48:56 +0000 (15:48 -0600)
commit20ac75e563d09f56fb00caa25a3afdb88573472d
treed120ec3d1779132a8bb0b085943e7b150f98cbc4
parent0e6053dc6e7a42c8ba9ce6e81adb3350c7df4bc8
PCI/AER: Fix aer_inject error codes

EPERM means "Operation not permitted", which doesn't reflect the lack of
support for AER.  EPROTONOSUPPORT (Protocol not supported) is a better
choice of error code if the device or its root port lack support for AER.

Likewise, EINVAL means "Invalid argument", which is not suitable for cases
where the AER error device is missing or unusable.  ENODEV and
EPROTONOSUPPORT, respectively, fit better.

Suggested-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Borislav Petkov <bp@suse.de>
CC: Prarit Bhargava <prarit@redhat.com>
drivers/pci/pcie/aer/aer_inject.c