[PATCH v13 3/6] of, numa: Add NUMA of binding implementation.
From: robh+dt@kernel.org (Rob Herring)
Date: 2016-03-04 00:21:36
Also in:
linux-devicetree, linux-efi, lkml
On Thu, Mar 3, 2016 at 11:33 AM, David Daney [off-list ref] wrote:
On 03/02/2016 07:34 PM, Rob Herring wrote:quoted
On Wed, Mar 2, 2016 at 4:55 PM, David Daney [off-list ref] wrote:quoted
From: David Daney <redacted> Add device tree parsing for NUMA topology using device "numa-node-id" property in distance-map and cpu nodes. This is a complete rewrite of a previous patch by: Ganapatrao Kulkarni[off-list ref] Signed-off-by: David Daney <redacted> --- drivers/of/Kconfig | 3 + drivers/of/Makefile | 1 + drivers/of/of_numa.c | 200 +++++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/of.h | 9 +++ 4 files changed, 213 insertions(+) create mode 100644 drivers/of/of_numa.c
[...]
quoted
quoted
+static int __init of_parse_distance_map(void) +{ + int ret = -EINVAL; + struct device_node *np = of_find_node_by_name(NULL, "distance-map"); + + if (!np) + return ret; + + if (of_device_is_compatible(np, "numa-distance-map-v1")) {You can use of_find_compatible_node() instead of these 2 calls.Well, we need to match exactly the name "distance-map", of_find_compatible_node() doesn't match on the name, so I think we need two checks, one for name and one for compatible.
Node names generally aren't supposed to matter and the kernel's job is not to validate DTs, So just finding the compatible should be enough. Not a big deal, so I've acked v14. If there's a v15, then please make the change. Rob