summaryrefslogtreecommitdiffstats
path: root/drivers/of/address.c
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2019-07-02 19:42:39 +0200
committerRob Herring <robh@kernel.org>2019-10-08 20:50:22 +0200
commitb68ac8dc22ebbf003e26e44bf4dd3030c076df5a (patch)
treed26b5be8ad883c6ca06698aa186bd11523df94ae /drivers/of/address.c
parentof: address: Follow DMA parent for "dma-coherent" (diff)
downloadlinux-b68ac8dc22ebbf003e26e44bf4dd3030c076df5a.tar.xz
linux-b68ac8dc22ebbf003e26e44bf4dd3030c076df5a.zip
of: Factor out #{addr,size}-cells parsing
In some cases such as PCI host controllers, we may have a "parent bus" which is an OF leaf node, but still need to correctly parse ranges from the point of view of that bus. For that, factor out variants of the "#addr-cells" and "#size-cells" parsers which do not assume they have a device node and thus immediately traverse upwards before reading the relevant property. Signed-off-by: Robin Murphy <robin.murphy@arm.com> [robh: don't make of_bus_n_{addr,size}_cells() public] 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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/of/address.c b/drivers/of/address.c
index 3fd34f7ad772..887c0413f648 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -14,6 +14,8 @@
#include <linux/slab.h>
#include <linux/string.h>
+#include "of_private.h"
+
/* Max address size we deal with */
#define OF_MAX_ADDR_CELLS 4
#define OF_CHECK_ADDR_COUNT(na) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS)