[PATCH v13 3/6] of, numa: Add NUMA of binding implementation.

Rob Herring robh+dt at kernel.org
Thu Mar 3 16:21:01 PST 2016


On Thu, Mar 3, 2016 at 11:33 AM, David Daney <ddaney at caviumnetworks.com> wrote:
> On 03/02/2016 07:34 PM, Rob Herring wrote:
>>
>> On Wed, Mar 2, 2016 at 4:55 PM, David Daney <ddaney.cavm at gmail.com> wrote:
>>>
>>> From: David Daney <david.daney at cavium.com>
>>>
>>> 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<gkulkarni at caviumnetworks.com>
>>>
>>> Signed-off-by: David Daney <david.daney at cavium.com>
>>> ---
>>>   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

[...]

>>> +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



More information about the linux-arm-kernel mailing list