提交 3c765399 编写于 作者: B Bjorn Helgaas

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: NBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: NJoerg Roedel <jroedel@suse.de>
上级 67930995
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册