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) {