From patchwork Wed Feb 3 21:59:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102853 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp108049lbl; Wed, 3 Feb 2016 14:00:45 -0800 (PST) X-Received: by 10.98.80.91 with SMTP id e88mr6009725pfb.62.1454536845594; Wed, 03 Feb 2016 14:00:45 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tl10si11624424pac.177.2016.02.03.14.00.45; Wed, 03 Feb 2016 14:00:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965231AbcBCWAo (ORCPT + 6 others); Wed, 3 Feb 2016 17:00:44 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:56397 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964815AbcBCWAn (ORCPT ); Wed, 3 Feb 2016 17:00:43 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0M2MnE-1aAf553Hhk-00s7BL; Wed, 03 Feb 2016 23:00:11 +0100 From: Arnd Bergmann To: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Grant Likely , Frank Rowand , Rob Herring , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] of: always define of_node_cmp() and other functions Date: Wed, 3 Feb 2016 22:59:51 +0100 Message-Id: <1454536806-3755190-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:tiG2Hl+GbS8yC+rUrzyzILELKK+AiEZFDKVe1davhvwAtHHhYNm RmWM7cAJkYJ5l98JhtZugWhxpbgMVrWRw81OfrjV4cjuDrblAkawOSROG92OX/9o8YIHKZP YkzkhVqtFWwdh8QXnrJDjEx+GGuAClOQ8OHg25yxCLDZZAYe+k+8rnNLsbjPj1vXP1r+7JT F89oyV9I6WPBqnufWDa8Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:burN1o/7yBI=:ksGnheXbiXXQzm//tFHNat oZOmISC+F/ftKimDqTEzWo/8neBt4E6b7L89+fuLoWDbHJc3XG/aKyEx6KZFB0ZLN3/fUIZOH xzERtz8/EhmJGqswbHK8eBYPl2IDDjEJ4vyev6zhkIjSplQlHR9SNaiLEnTg7Dfsc/eAcvgx5 dvjtJo9bdoDUqjfF3NTppzTU1WsLy5/NulYWjRtT6/mcxJEfpjCEhmbO3ZGCJABu86SbUbiGl OTV0i/kddSrBKyRwO8Q2ttFnQ1dVFBKFJ1Y1pjjJ6ZwImCw1G06Gdw88dFHkP4/u1xzhFAG1t m+JV8bNG+j4iyYvX9R2HGID98dA7LFXz6P+6cnQE77a54MuXmykCUv+jQx3jHz7IQHHPiqg7O VDv4OpvOU0s26Al2v3doPiiHqVfpkTg5pDsvdwpxRtlCToaPdWE20/S+jyV7oZaHNRnH6F3u6 Jtfqbr+QE7q2JaBAl6z9DrcvcpuXfjM3dlKvZtqhA8b91MP1TMyvgNht01HOmYUofciaSeQPi 2m+X+TiYEyiYjiBQAEwpGeSO02rkZcgPDuMQl8UEEfRXsqOdKGUuv7xvJQfcJHsY0XdeN2kJz eClEFw7sNYTAF8XlE8xz63x4YzLkRT6UX/snGwrh0b4/OIO8Whsb1+GqwqCAHwcWKI2GmxpKV VWqar0w3TvNokKGZoTAPd2cTBLj3vZt8Y67jLouzLYvjPk9kCtVSOtVy3ywygeSvyo84= Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The ti-vpe driver started using of_node_cmp(), and it can be used when CONFIG_OF is disabled, which results in a build failure: drivers/media/platform/ti-vpe/cal.c: In function 'of_get_next_port': drivers/media/platform/ti-vpe/cal.c:1655:12: error: implicit declaration of function 'of_node_cmp' [-Werror=implicit-function-declaration] There is no reason for this, we can simply move the definition outside of the #ifdef CONFIG_OF section without any downsides. Signed-off-by: Arnd Bergmann --- include/linux/of.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/of.h b/include/linux/of.h index dc6e39696b64..f8d9b558f9bd 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -128,6 +128,23 @@ extern raw_spinlock_t devtree_lock; #define OF_BAD_ADDR ((u64)-1) +#if defined(CONFIG_SPARC) +#include +#endif + +/* Default #address and #size cells. Allow arch asm/prom.h to override */ +#if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT) +#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 +#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 +#endif + +/* Default string compare functions, Allow arch asm/prom.h to override */ +#if !defined(of_compat_cmp) +#define of_compat_cmp(s1, s2, l) strcasecmp((s1), (s2)) +#define of_prop_cmp(s1, s2) strcmp((s1), (s2)) +#define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) +#endif + #ifdef CONFIG_OF void of_core_init(void); @@ -211,23 +228,6 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size) return of_read_number(cell, size); } -#if defined(CONFIG_SPARC) -#include -#endif - -/* Default #address and #size cells. Allow arch asm/prom.h to override */ -#if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT) -#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 -#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 -#endif - -/* Default string compare functions, Allow arch asm/prom.h to override */ -#if !defined(of_compat_cmp) -#define of_compat_cmp(s1, s2, l) strcasecmp((s1), (s2)) -#define of_prop_cmp(s1, s2) strcmp((s1), (s2)) -#define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) -#endif - #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) From patchwork Wed Feb 3 21:59:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102852 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp108289lbl; Wed, 3 Feb 2016 14:01:11 -0800 (PST) X-Received: by 10.66.141.11 with SMTP id rk11mr5761773pab.156.1454536871707; Wed, 03 Feb 2016 14:01:11 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l81si11722173pfb.18.2016.02.03.14.01.11; Wed, 03 Feb 2016 14:01:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965277AbcBCWBI (ORCPT + 6 others); Wed, 3 Feb 2016 17:01:08 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:49486 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964815AbcBCWBF (ORCPT ); Wed, 3 Feb 2016 17:01:05 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MQert-1adM3R3iqz-00U55e; Wed, 03 Feb 2016 23:00:25 +0100 From: Arnd Bergmann To: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Grant Likely , Frank Rowand , Rob Herring , Lucas Stach , Bjorn Helgaas , Magnus Damm , Geert Uytterhoeven , Ben Dooks , linux-pci@vger.kernel.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] of: provide of_n_{addr, size}_cells wrappers for !CONFIG_OF Date: Wed, 3 Feb 2016 22:59:52 +0100 Message-Id: <1454536806-3755190-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1454536806-3755190-1-git-send-email-arnd@arndb.de> References: <1454536806-3755190-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:GmoLiBbcYdsZVmWsY5kfExqOyzHpqWXwg9eOsQBTQ+2bSLHIj2p TaE3qH78H3tRJ4fteIabx+s+kwMpfnIt6DzB5mPwvMEZQirOx6VgbszApgyJbPBReTd2S2H TacjvqBKEWpIoFh3q2/CZg3/bbxxt+QYX5Z/6YMz83S/9b6O1fsHo+NfgIt580Ptj4nS180 tkx8VqGSUfZFdMbFMtuqw== X-UI-Out-Filterresults: notjunk:1; V01:K0:1LSzKpujfwM=:5g8PDbzt/p7yKGpOSb9yqD u+rLX4KsdjlFgHY8BoAWOn3D9HVrtVg5oTTrMnuiNlyVtSHZ1U51nWZbWfgqHAJBxDG+c4vO+ oo6FJqrm5jlK2MTGuIf7MdOgIxLlB43qcog++Da3JsRYIIQrFuXEizjDMedW0hQPuMP98wzBw BlaVO456dqmOQFBhOh+ArBMvZkQf3ZqP/bQJmLzs9T9y8QUvZxXorxp9DogexurOUV3Tb4fyp xsai7fw+Myzp7wZSYFTk5AHuY0DDggdPRr3JkLIF8s9uljjv9jhviTYOyd5uM7I6MLfChsrf9 dxXGt1jTGy0kyodeOJJbRcjcDNTL3bJ3LpIuV+pQH9JVmViT1yArs7KqFZR+XMdtt6r6dwUut +NuM2cY5OZhlng93NI3SX5PHTF0cxynRj6eRHSYoYQlEvfRr+2un8pei+UcM3YG4c+qbknxdP XebkhEJIIDlikKjyK0wNuXvg5vPi3evOcD/wnQVA2Uxzycq/2A4jAgM4s/IlsFq+GtrpwAWue tVs9A+cI2P9iZdsnZQdl7pAFkPPENb4Xnlim9Xh2TqNjH/jVUsRtjADBkeST1NCY3JNmASiik ZZxafK6vohtjqsRcimr6XRFTNDYqozj492v8AvVDpTdgIEpXKW7Mfg0sLuaJfVhMnzcx9kJTN qvhx1v4010M+4ETGvLGfTdilu39TgmfD/IEXzURJduZG8ltYteZ5snPuy0mh3jHLp6Tc= Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The pci-rcar driver is enabled for compile tests, and this has now shown that the driver cannot build without CONFIG_OF, following the inclusion of f8f2fe7355fb "PCI: rcar: Use new OF interrupt mapping when possible": ../drivers/pci/host/pcie-rcar.c: In function 'pci_dma_range_parser_init': ../drivers/pci/host/pcie-rcar.c:856:2: error: implicit declaration of function 'of_n_addr_cells' [-Werror=implicit-function-declaration] parser->pna = of_n_addr_cells(node); ^ As pointed out by Ben Dooks and Geert Uytterhoeven, this is actually supposed to build fine, which we can achieve if we make the declaration of of_irq_parse_and_map_pci conditional on CONFIG_OF and provide an empty inline function otherwise, as we do for a lot of other of interfaces. This lets us build the rcar_pci driver again without CONFIG_OF for build testing. All platforms using this driver select OF, so this doesn't change anything for the users. Signed-off-by: Arnd Bergmann Cc: devicetree@vger.kernel.org Cc: Rob Herring Cc: Grant Likely Cc: Lucas Stach Cc: Bjorn Helgaas Cc: Magnus Damm Cc: Geert Uytterhoeven Cc: Ben Dooks Cc: linux-pci@vger.kernel.org Cc: linux-sh@vger.kernel.org --- I originally sent the patch in 2014 when things initially broke and then forgot about while it was applied in my randconfig patch stack. It's still broken and I think this is hte correct fix. --- include/linux/of.h | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/of.h b/include/linux/of.h index f8d9b558f9bd..9c941cd3ba58 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -565,6 +565,9 @@ static inline struct device_node *of_get_cpu_node(int cpu, return NULL; } +static inline int of_n_addr_cells(struct device_node *np) { return 0; } +static inline int of_n_size_cells(struct device_node *np) { return 0; } + static inline int of_property_read_u64(const struct device_node *np, const char *propname, u64 *out_value) {