提交 1fde2548 编写于 作者: Y Yijing Wang 提交者: Dan Williams

ioat/dca: Use dev_is_pci() to check whether it is pci device

Use PCI standard marco dev_is_pci() instead of directly compare
pci_bus_type to check whether it is pci device.
Signed-off-by: NYijing Wang <wangyijing@huawei.com>
Signed-off-by: NDan Williams <dan.j.williams@intel.com>
上级 dcb99fd9
...@@ -147,7 +147,7 @@ static int ioat_dca_add_requester(struct dca_provider *dca, struct device *dev) ...@@ -147,7 +147,7 @@ static int ioat_dca_add_requester(struct dca_provider *dca, struct device *dev)
u16 id; u16 id;
/* This implementation only supports PCI-Express */ /* This implementation only supports PCI-Express */
if (dev->bus != &pci_bus_type) if (!dev_is_pci(dev))
return -ENODEV; return -ENODEV;
pdev = to_pci_dev(dev); pdev = to_pci_dev(dev);
id = dcaid_from_pcidev(pdev); id = dcaid_from_pcidev(pdev);
...@@ -179,7 +179,7 @@ static int ioat_dca_remove_requester(struct dca_provider *dca, ...@@ -179,7 +179,7 @@ static int ioat_dca_remove_requester(struct dca_provider *dca,
int i; int i;
/* This implementation only supports PCI-Express */ /* This implementation only supports PCI-Express */
if (dev->bus != &pci_bus_type) if (!dev_is_pci(dev))
return -ENODEV; return -ENODEV;
pdev = to_pci_dev(dev); pdev = to_pci_dev(dev);
...@@ -320,7 +320,7 @@ static int ioat2_dca_add_requester(struct dca_provider *dca, struct device *dev) ...@@ -320,7 +320,7 @@ static int ioat2_dca_add_requester(struct dca_provider *dca, struct device *dev)
u16 global_req_table; u16 global_req_table;
/* This implementation only supports PCI-Express */ /* This implementation only supports PCI-Express */
if (dev->bus != &pci_bus_type) if (!dev_is_pci(dev))
return -ENODEV; return -ENODEV;
pdev = to_pci_dev(dev); pdev = to_pci_dev(dev);
id = dcaid_from_pcidev(pdev); id = dcaid_from_pcidev(pdev);
...@@ -354,7 +354,7 @@ static int ioat2_dca_remove_requester(struct dca_provider *dca, ...@@ -354,7 +354,7 @@ static int ioat2_dca_remove_requester(struct dca_provider *dca,
u16 global_req_table; u16 global_req_table;
/* This implementation only supports PCI-Express */ /* This implementation only supports PCI-Express */
if (dev->bus != &pci_bus_type) if (!dev_is_pci(dev))
return -ENODEV; return -ENODEV;
pdev = to_pci_dev(dev); pdev = to_pci_dev(dev);
...@@ -496,7 +496,7 @@ static int ioat3_dca_add_requester(struct dca_provider *dca, struct device *dev) ...@@ -496,7 +496,7 @@ static int ioat3_dca_add_requester(struct dca_provider *dca, struct device *dev)
u16 global_req_table; u16 global_req_table;
/* This implementation only supports PCI-Express */ /* This implementation only supports PCI-Express */
if (dev->bus != &pci_bus_type) if (!dev_is_pci(dev))
return -ENODEV; return -ENODEV;
pdev = to_pci_dev(dev); pdev = to_pci_dev(dev);
id = dcaid_from_pcidev(pdev); id = dcaid_from_pcidev(pdev);
...@@ -530,7 +530,7 @@ static int ioat3_dca_remove_requester(struct dca_provider *dca, ...@@ -530,7 +530,7 @@ static int ioat3_dca_remove_requester(struct dca_provider *dca,
u16 global_req_table; u16 global_req_table;
/* This implementation only supports PCI-Express */ /* This implementation only supports PCI-Express */
if (dev->bus != &pci_bus_type) if (!dev_is_pci(dev))
return -ENODEV; return -ENODEV;
pdev = to_pci_dev(dev); pdev = to_pci_dev(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册