Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25f32223 authored by weiping zhang's avatar weiping zhang Committed by Michael S. Tsirkin
Browse files

virtio_mmio: add cleanup for virtio_mmio_remove



cleanup all resource allocated by virtio_mmio_probe.

Signed-off-by: default avatarweiping zhang <zhangweiping@didichuxing.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
parent 7eb781b1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -610,7 +610,13 @@ static int virtio_mmio_probe(struct platform_device *pdev)
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;