Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932183AbcCDAVg (ORCPT ); Thu, 3 Mar 2016 19:21:36 -0500 Received: from mail.kernel.org ([198.145.29.136]:47564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751010AbcCDAVd (ORCPT ); Thu, 3 Mar 2016 19:21:33 -0500 MIME-Version: 1.0 In-Reply-To: <56D87572.3090002@caviumnetworks.com> References: <1456959362-2036-1-git-send-email-ddaney.cavm@gmail.com> <1456959362-2036-4-git-send-email-ddaney.cavm@gmail.com> <56D87572.3090002@caviumnetworks.com> From: Rob Herring Date: Thu, 3 Mar 2016 18:21:01 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v13 3/6] of, numa: Add NUMA of binding implementation. To: David Daney Cc: David Daney , Will Deacon , "linux-arm-kernel@lists.infradead.org" , Frank Rowand , Grant Likely , Pawel Moll , Ian Campbell , Kumar Gala , Ganapatrao Kulkarni , Robert Richter , Ard Biesheuvel , Matt Fleming , Mark Rutland , Catalin Marinas , "linux-efi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , David Daney Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1655 Lines: 51 On Thu, Mar 3, 2016 at 11:33 AM, David Daney wrote: > On 03/02/2016 07:34 PM, Rob Herring wrote: >> >> On Wed, Mar 2, 2016 at 4:55 PM, David Daney wrote: >>> >>> From: David Daney >>> >>> 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 >>> >>> Signed-off-by: David Daney >>> --- >>> 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