aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2015-01-16 17:04:56 +0000
committerAlex Shi <alex.shi@linaro.org>2015-10-26 13:52:10 +0800
commitfdf9406cebdb0100752a7440452f0d8c30146f7d (patch)
tree0fe11eee227880be99d49f784d54c688e4b6076e
parente8914e4d71488cbf9703d6b101348e3e6f7d2656 (diff)
of/platform: teardown DMA mappings on device destruction
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> (cherry picked from commit 0495cb75ed301bbe6b01346cbf8bc5244a2948b2) Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r--drivers/of/platform.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index e9fcdd0049c9..c3b742a070bd 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -525,6 +525,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;