bcm27xx: update to latest patches from RPi foundation
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0435-of-address-Introduce-of_get_next_dma_parent-helper.patch
1 From 25ab98ceb9844642c994b5766de1033552d1aef2 Mon Sep 17 00:00:00 2001
2 From: Robin Murphy <robin.murphy@arm.com>
3 Date: Wed, 3 Jul 2019 18:23:01 +0100
4 Subject: [PATCH] of/address: Introduce of_get_next_dma_parent() helper
5
6 commit 862ab5578f754117742c8b8c8e5ddf98bdb190ba upstream.
7
8 Add of_get_next_dma_parent() helper which is similar to
9 __of_get_dma_parent(), but can be used in iterators and decrements the
10 ref count on the prior parent.
11
12 Signed-off-by: Robin Murphy <robin.murphy@arm.com>
13 Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
14 Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
15 Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
16 Signed-off-by: Rob Herring <robh@kernel.org>
17 ---
18 drivers/of/address.c | 10 ++++++++++
19 1 file changed, 10 insertions(+)
20
21 --- a/drivers/of/address.c
22 +++ b/drivers/of/address.c
23 @@ -695,6 +695,16 @@ static struct device_node *__of_get_dma_
24 return of_node_get(args.np);
25 }
26
27 +static struct device_node *of_get_next_dma_parent(struct device_node *np)
28 +{
29 + struct device_node *parent;
30 +
31 + parent = __of_get_dma_parent(np);
32 + of_node_put(np);
33 +
34 + return parent;
35 +}
36 +
37 u64 of_translate_dma_address(struct device_node *dev, const __be32 *in_addr)
38 {
39 struct device_node *host;