summaryrefslogtreecommitdiff
path: root/drivers/pci/ats.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/ats.c')
-rw-r--r--drivers/pci/ats.c8
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);