of/platform: teardown DMA mappings on device destruction
authorWill Deacon <will.deacon@arm.com>
Fri, 16 Jan 2015 17:04:56 +0000 (17:04 +0000)
committerOlof Johansson <olof@lixom.net>
Wed, 21 Jan 2015 23:15:14 +0000 (15:15 -0800)
Now that we can create and attach to IOMMU domains via of_dma_configure,
make sure we give the architecture a chance to tear them down when a
platform or amba device is destroyed.

Acked-by: Rob Herring <robh@kernel.org>
Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
drivers/of/platform.c

index 5b33c6a2180752888a36e7a15f81b81f29c8477a..3f61d668ded7bb50d9165d9a0ab0856a77801b48 100644 (file)
@@ -526,6 +526,7 @@ static int of_platform_device_destroy(struct device *dev, void *data)
                amba_device_unregister(to_amba_device(dev));
 #endif
 
+       of_dma_deconfigure(dev);
        of_node_clear_flag(dev->of_node, OF_POPULATED);
        of_node_clear_flag(dev->of_node, OF_POPULATED_BUS);
        return 0;