提交 35152865 编写于 作者: J Jason Wang 提交者: Pengyuan Zhao

virtio-pci-modern: introduce vp_modern_remove()

stable inclusion
from stable-v5.12
commit 32490370
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5WXCZ
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=32490370883822e9e8dd7e4410bbe22bb3b77b58

----------------------------------------------------------------------

This patch introduces vp_modern_remove() doing device resources
cleanup to make it can be used.
Signed-off-by: NJason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20210104065503.199631-5-jasowang@redhat.comSigned-off-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NPengyuan Zhao <zhaopengyuan@hisilicon.com>
上级 2b9c293a
......@@ -873,9 +873,12 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
return 0;
}
void virtio_pci_modern_remove(struct virtio_pci_device *vp_dev)
/*
* vp_modern_probe: remove and cleanup the modern virtio pci device
* @mdev: the modern virtio-pci device
*/
static void vp_modern_remove(struct virtio_pci_modern_device *mdev)
{
struct virtio_pci_modern_device *mdev = &vp_dev->mdev;
struct pci_dev *pci_dev = mdev->pci_dev;
if (mdev->device)
......@@ -886,3 +889,10 @@ void virtio_pci_modern_remove(struct virtio_pci_device *vp_dev)
pci_iounmap(pci_dev, mdev->common);
pci_release_selected_regions(pci_dev, mdev->modern_bars);
}
void virtio_pci_modern_remove(struct virtio_pci_device *vp_dev)
{
struct virtio_pci_modern_device *mdev = &vp_dev->mdev;
vp_modern_remove(mdev);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册