diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2015-07-17 22:30:26 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-08-13 22:57:22 +0200 |
commit | 3c765399524308ab36777a443ce77e19810a97d7 (patch) | |
tree | 2698456eafb15a32339f5d177fc6bb413e1bb321 /drivers/pci/ats.c | |
parent | PCI: Reduce size of ATS structure elements (diff) | |
download | linux-3c765399524308ab36777a443ce77e19810a97d7.tar.xz linux-3c765399524308ab36777a443ce77e19810a97d7.zip |
PCI: Rationalize pci_ats_queue_depth() error checking
We previously returned -ENODEV for devices that don't support ATS (except
that we always returned 0 for VFs, whether or not they support ATS).
For consistency, always return -EINVAL (not -ENODEV) if the device doesn't
support ATS. Return zero for VFs that support ATS.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/pci/ats.c')
-rw-r--r-- | drivers/pci/ats.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c index 690ae6e6786c..9a98b3a4f983 100644 --- a/drivers/pci/ats.c +++ b/drivers/pci/ats.c @@ -136,13 +136,13 @@ EXPORT_SYMBOL_GPL(pci_restore_ats_state); */ int pci_ats_queue_depth(struct pci_dev *dev) { + if (!dev->ats_cap) + return -EINVAL; + if (dev->is_virtfn) return 0; - if (dev->ats_cap) - return dev->ats_qdep; - - return -ENODEV; + return dev->ats_qdep; } EXPORT_SYMBOL_GPL(pci_ats_queue_depth); |