summaryrefslogtreecommitdiff
path: root/drivers/of/address.c
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2019-07-03 20:23:01 +0300
committerRob Herring <robh@kernel.org>2019-10-08 21:50:22 +0300
commit862ab5578f754117742c8b8c8e5ddf98bdb190ba (patch)
tree24dcec3ad07c3c192ee710f2fd33173c22573363 /drivers/of/address.c
parent76dd7068e32cec3389474d6f69ffd4d0536172da (diff)
downloadlinux-862ab5578f754117742c8b8c8e5ddf98bdb190ba.tar.xz
of/address: Introduce of_get_next_dma_parent() helper
Add of_get_next_dma_parent() helper which is similar to __of_get_dma_parent(), but can be used in iterators and decrements the ref count on the prior parent. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/address.c')
-rw-r--r--drivers/of/address.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/of/address.c b/drivers/of/address.c
index 53d2656c2269..e9188c82fdae 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -695,6 +695,16 @@ static struct device_node *__of_get_dma_parent(const struct device_node *np)
return of_node_get(args.np);
}
+static struct device_node *of_get_next_dma_parent(struct device_node *np)
+{
+ struct device_node *parent;
+
+ parent = __of_get_dma_parent(np);
+ of_node_put(np);
+
+ return parent;
+}
+
u64 of_translate_dma_address(struct device_node *dev, const __be32 *in_addr)
{
struct device_node *host;