提交 be99cca5 编写于 作者: T tanshukun 提交者: Xie XiuQi

crypto/hisilicon/qm: use devm_ioremap instead of ioremap

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

The design goal of the managed resource API (the devm_ stuff) is to avoid
calling unmap, free etc. It can avoid concurrency problem when resetting.

Feature or Bugfix:Bugfix
Signed-off-by: Ntanshukun (A) <tanshukun1@huawei.com>
Reviewed-by: Nwangzhou <wangzhou1@hisilicon.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 7afc9bf8
......@@ -1954,8 +1954,8 @@ int hisi_qm_init(struct hisi_qm *qm)
qm->phys_base = pci_resource_start(pdev, PCI_BAR_2);
qm->size = pci_resource_len(qm->pdev, PCI_BAR_2);
#endif
qm->io_base = ioremap(pci_resource_start(pdev, PCI_BAR_2),
pci_resource_len(qm->pdev, PCI_BAR_2));
qm->io_base = devm_ioremap(dev, pci_resource_start(pdev, PCI_BAR_2),
pci_resource_len(qm->pdev, PCI_BAR_2));
if (!qm->io_base) {
ret = -EIO;
goto err_release_mem_regions;
......@@ -1993,7 +1993,7 @@ int hisi_qm_init(struct hisi_qm *qm)
err_free_irq_vectors:
pci_free_irq_vectors(pdev);
err_iounmap:
iounmap(qm->io_base);
devm_iounmap(dev, qm->io_base);
err_release_mem_regions:
pci_release_mem_regions(pdev);
err_disable_pcidev:
......@@ -2029,7 +2029,6 @@ void hisi_qm_uninit(struct hisi_qm *qm)
qm_irq_unregister(qm);
pci_free_irq_vectors(pdev);
iounmap(qm->io_base);
pci_release_mem_regions(pdev);
pci_disable_device(pdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册