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: 8209451 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 35259BEEE5 for ; Wed, 3 Feb 2016 22:01:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FEED202C8 for ; Wed, 3 Feb 2016 22:01:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2975620270 for ; Wed, 3 Feb 2016 22:01:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965282AbcBCWBJ (ORCPT ); Wed, 3 Feb 2016 17:01:09 -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: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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) {