Message ID | 20190927002455.13169-7-robh@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show |
Series | of: dma-ranges fixes and improvements | expand |
On Fri, Sep 27, 2019 at 2:25 AM Rob Herring <robh@kernel.org> wrote: > From: Robin Murphy <robin.murphy@arm.com> > > 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> > Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Gr{oetje,eeting}s, Geert
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;