提交 4748750b 编写于 作者: H Hao Fang 提交者: Xie XiuQi

zip/qm: bugfix: modify zip as parent module for wd spimdev device

Fix the zip as the spimdev->owner, so if mdev created, zip module
can't be remove. If want to remove zip module, first remove mdev
once mdev have created.

Feature or Bugfix:Bugfix
Signed-off-by: NHao Fang <fanghao11@huawei.com>
Reviewed-by: Nxuzaibo <xuzaibo@huawei.com>
Reviewed-by: Nhuangdaode <huangdaode@hisilicon.com>
上级 aa6b5c1c
...@@ -1723,7 +1723,7 @@ static int qm_register_spimdev(struct hisi_qm *qm) ...@@ -1723,7 +1723,7 @@ static int qm_register_spimdev(struct hisi_qm *qm)
spimdev->iommu_type = VFIO_SPIMDEV_IOMMU; spimdev->iommu_type = VFIO_SPIMDEV_IOMMU;
spimdev->dma_flag = VFIO_SPIMDEV_DMA_PHY; spimdev->dma_flag = VFIO_SPIMDEV_DMA_PHY;
#endif #endif
spimdev->owner = THIS_MODULE; spimdev->owner = qm->parent;
spimdev->name = qm->dev_name; spimdev->name = qm->dev_name;
spimdev->dev = &pdev->dev; spimdev->dev = &pdev->dev;
spimdev->is_vf = pdev->is_virtfn; spimdev->is_vf = pdev->is_virtfn;
......
...@@ -113,6 +113,7 @@ struct hisi_qm { ...@@ -113,6 +113,7 @@ struct hisi_qm {
const char *dev_name; const char *dev_name;
struct pci_dev *pdev; struct pci_dev *pdev;
void __iomem *io_base; void __iomem *io_base;
struct module *parent;
u32 sqe_size; u32 sqe_size;
u32 qp_base; u32 qp_base;
u32 qp_num; u32 qp_num;
......
...@@ -555,7 +555,7 @@ static int hisi_zip_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -555,7 +555,7 @@ static int hisi_zip_probe(struct pci_dev *pdev, const struct pci_device_id *id)
qm = &hisi_zip->qm; qm = &hisi_zip->qm;
qm->pdev = pdev; qm->pdev = pdev;
qm->parent = THIS_MODULE;
rev_id = hisi_qm_get_hw_version(qm); rev_id = hisi_qm_get_hw_version(qm);
if (rev_id < 0) if (rev_id < 0)
return rev_id; return rev_id;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册