mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-29 04:45:05 +00:00
virtio_mmio: add cleanup for virtio_mmio_remove
cleanup all resource allocated by virtio_mmio_probe. Signed-off-by: weiping zhang <zhangweiping@didichuxing.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
This commit is contained in:
parent
7eb781b1bb
commit
25f32223bc
@ -610,7 +610,13 @@ free_vmdev:
|
||||
static int virtio_mmio_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct virtio_mmio_device *vm_dev = platform_get_drvdata(pdev);
|
||||
struct resource *mem;
|
||||
|
||||
iounmap(vm_dev->base);
|
||||
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (mem)
|
||||
devm_release_mem_region(&pdev->dev, mem->start,
|
||||
resource_size(mem));
|
||||
unregister_virtio_device(&vm_dev->vdev);
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user