From patchwork Mon Sep 11 20:07:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9948087 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 656B1603F4 for ; Mon, 11 Sep 2017 20:09:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D8B528D36 for ; Mon, 11 Sep 2017 20:09:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5226C28D39; Mon, 11 Sep 2017 20:09:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DE4428D4C for ; Mon, 11 Sep 2017 20:09:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751557AbdIKUIX (ORCPT ); Mon, 11 Sep 2017 16:08:23 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:51823 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751548AbdIKUIV (ORCPT ); Mon, 11 Sep 2017 16:08:21 -0400 Received: from wuerfel.lan ([95.208.190.237]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MFLHA-1ddB7c2vky-00EQrl; Mon, 11 Sep 2017 22:08:08 +0200 From: Arnd Bergmann To: Andrew Morton , Rob Herring , Frank Rowand Cc: Arnd Bergmann , Bjorn Helgaas , Magnus Damm , Geert Uytterhoeven , Ben Dooks , linux-pci@vger.kernel.org, linux-sh@vger.kernel.org, Sakari Ailus , Mika Westerberg , Geert Uytterhoeven , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] [RESEND] of: provide of_n_{addr, size}_cells wrappers for !CONFIG_OF Date: Mon, 11 Sep 2017 22:07:49 +0200 Message-Id: <20170911200805.3363318-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:N0NaIlP3TCa65KhsUOIhZQSiIE6mbL4GM6fY9y4bfaU736cH+F9 pHcY+qm2Sv80aBP5uV9jsEuhvaiN9Hf4xboNYh5j56t4ZiOzAdo3o1RtkFGuLU1aMUEkuXl GgUQCQd++UgkMJc0FAcqz/3e3y7Lz7l51VBCXnEF0ZM3hwKpe7vICBGLKiM2/ANESM1QZhG xdRoY67dZVPCMW2TW8ZPg== X-UI-Out-Filterresults: notjunk:1; V01:K0:vEjisVYbdpQ=:Q79R4kazB/BhkDPenmPbKs qIKhI5qYHXT6P8yqS2v9pr2/OiR/tQ2BEuGePJgWiuFmeUZRHamYZtYMhsPSxC9XYgPrNIohX mGqQiWLSlZMM78AG3I1GS+H/gdwkgg8Eb2An5QjJ1ZSLTaMsxuPyet4xfrVs6JDMD4Zmiw1ao YToWm4/Mxzy/iOXcppOxHVJcF7Dxpyr0EuPtUMBb05i9GiPbQK6PTLR6a67s+3GSEAGIFOiMh a4jj6YsY6dvgwjzwdDQcOPsw7SzveYDlD28sUbkbWWQ1jBBNbeOynzynCNxjmwH1BPbfbqrFO 5bCa5k7dKsJuYPtLw/QRR6AmiIvI0rs/Omk+WE6+gOvslIKjgwk4pf3+3e+bvAC6LeFjooOAO C6bwUpUv0WoWMmxX4NRLHWn8cHF4eKAv/stqCbiVcuv/lNXE3ZOBkzaGoZFSTtPFnIdeH08RD dwAWayYOeg2MLs64AreFIdOddiiAQ9O1bx5/X/Pg/JWu7v0DC0N6W1UfwqE1JzVJIibSbj+29 Bcm+cjxU+29dZ6KJXRLcm7Wq5dQ9u/1/kl11ZZiiQ/fIGbth5/c0vmaQmVmkmI6TcMJd6J7XS E7YDQGnfBIsTM3jOOmwUP0f+C5f7chPVVXp4YlpCm1dqVey1tutXKCS459RmhvDzRB9WNYnOv OCWj4auTwdLPIq80GTK4Siuakhm+JlEZcWI/WdRlNwELIURGz9m+MafJoi64bUWFoobB0G6U1 /IiXhfjyQj62IOJ4cyzA9a/9pP8FrcYGYcY2DA== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The pci-rcar driver is enabled for compile tests, and this has 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:1039: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. Cc: Bjorn Helgaas Cc: Magnus Damm Cc: Geert Uytterhoeven Cc: Ben Dooks Cc: linux-pci@vger.kernel.org Cc: linux-sh@vger.kernel.org Acked-by: Geert Uytterhoeven Reviewed-by: Frank Rowand Fixes: c25da4778803 ("PCI: rcar: Add Renesas R-Car PCIe driver") Signed-off-by: Arnd Bergmann --- I originally sent the patch in 2014 when things initially broke and then forgot about while it was applied in my randconfig patch stack. I sent it again in 2016 and then in July 2017 without reply. It's still broken and I think this is the 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 cfc34117fc92..fb700d1e1fab 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -734,6 +734,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) {