aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
diff options
context:
space:
mode:
authorWei Hu(Xavier) <xavier.huwei@huawei.com>2017-08-30 17:23:02 +0800
committerDoug Ledford <dledford@redhat.com>2017-09-27 08:34:55 -0400
commit13ca970e3692e498e1544d0c5141f20da9a8e89d (patch)
tree2517a1c485320fcc6c8a9b80e587f091b5670d00 /drivers/infiniband/hw/hns/hns_roce_hw_v1.c
parentRDMA/hns: Initialize the PCI device for hip08 RoCE (diff)
downloadlinux-dev-13ca970e3692e498e1544d0c5141f20da9a8e89d.tar.xz
linux-dev-13ca970e3692e498e1544d0c5141f20da9a8e89d.zip
RDMA/hns: Modify assignment device variable to support both PCI device and platform device
In order to support the scalability of the hardware version, the features irrelevant to the hardware will be located in the hns-roce.ko, and the hardware relevant operations will be located in hns_roce_hw_v1.ko or hns_roce_hw_v2.ko based on the series chips. The hip08 RoCE engine is a PCI device, hip06 RoCE engine is a platform device. In order to support both platform device and PCI device, We replace &hr_dev->pdev->dev with hr_dev->dev in hns-roce.ko as belows: Before modification: struct device *dev = hr_dev->dev; After modification: struct device *dev = &hr_dev->pdev->dev; The related structure: struct hns_roce_dev { ... struct platform_device *pdev; struct pci_dev *pci_dev; struct device *dev; ... } Signed-off-by: Lijun Ou <oulijun@huawei.com> Signed-off-by: Shaobo Xu <xushaobo2@huawei.com> Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hns/hns_roce_hw_v1.c')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v1.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index e4d13a93ef63..22cc3fb6c631 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -4050,6 +4050,7 @@ static int hns_roce_probe(struct platform_device *pdev)
}
hr_dev->pdev = pdev;
+ hr_dev->dev = dev;
platform_set_drvdata(pdev, hr_dev);
if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64ULL)) &&