From patchwork Fri Jul 21 20:19:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9857647 X-Patchwork-Delegate: bhelgaas@google.com 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 1C36D60392 for ; Fri, 21 Jul 2017 20:21:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E5F528668 for ; Fri, 21 Jul 2017 20:21:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02D24285C7; Fri, 21 Jul 2017 20:21:07 +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=ham 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 9823528668 for ; Fri, 21 Jul 2017 20:21:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753602AbdGUUVE (ORCPT ); Fri, 21 Jul 2017 16:21:04 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:56500 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752811AbdGUUVC (ORCPT ); Fri, 21 Jul 2017 16:21:02 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0MfIB0-1dEG101ulW-00OsEO; Fri, 21 Jul 2017 22:20:20 +0200 From: Arnd Bergmann To: Rob Herring , Frank Rowand Cc: Arnd Bergmann , devicetree@vger.kernel.org, Grant Likely , Lucas Stach , Bjorn Helgaas , Magnus Damm , Geert Uytterhoeven , Ben Dooks , linux-pci@vger.kernel.org, linux-sh@vger.kernel.org, Sakari Ailus , Sudeep Holla , "Rafael J. Wysocki" , Kieran Bingham , Alan Tull , Geert Uytterhoeven , Richard Fitzgerald , linux-kernel@vger.kernel.org Subject: [PATCH] of: provide of_n_{addr,size}_cells wrappers for !CONFIG_OF Date: Fri, 21 Jul 2017 22:19:58 +0200 Message-Id: <20170721202012.3360244-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:m0AJDlvFNFN5S4BekrJw8eDPuyfvl15Y0rRnJQ4yczpYbEMBgUn 1Qufo223VM4mMtoHCoYeKgtAI5UTwPU09G5oRzcvznk1k+D6GzkKtk/UO2EGAU/jFvWYGLy crEkM/O4NYMNJHYi1BLAAjrnT3AHHPADhzvn6PV3d5/Zoxeq+UYmpL1Mwtr12Hy4PTi6w+s +qzRMD7bvFNG2RIfMMs2g== X-UI-Out-Filterresults: notjunk:1; V01:K0:uJJeMPH9gU8=:WqFQnLZta3m6Xnj+Eb6S0m KC6g1yw03rx4zi5p4oTbrAlgXk5K1yK0F+UpL7cR3hB3Asem0BkU0GCEr1gVu7t4M87/iBQeb podkhQGFczuRdewW0DBXLeZJ/F2bXmF5NvwGx3jRDylfjzxDnPuFWpGMxi+P/FcMKHsqd0DtG cKTBF3RwHPDHMLBMhUGdQs5SwGAYQWB3XaqTtBsLxMQN84txW/N6OEi7B1Y1quv9yszPGm/fo C/P4FG2DXkj0UzvJeBFwtdrhSuwRNUmAf3JrueftjRZzIjPbRsxIsPP4uT9nXKlbfPiCoDWME NBwT/fo4DuJAxJRmyIEF5fIcSC6mlqOgo5xtZPx+76ymHDHi9q6Fz5zMJcIw3mXpMkIEH880I 5eFTkoCjOg/H6S2RVZ65THP7jT/OiwXXl05AMAiaSikKppGXF/9+hsxXQEQFL1z1xd3mhdayt 6DLHEDKfiQnR6yOKhExN6RuNydoOZS9lLAvcdZXpbdLolFmojwoGWmYXT1si2vZIbe99kGvCo 1XbbO01rHJUglcCljVvhvHGRdvtP2Ks3M51nMcTew6Pnr6H3Gvi2RqSS8iiY8QdDx/hVTOcrM fUD6SCo66Kpouak/fB4Fx5wkYuSe0v7vhe60OMJVrs154AnM9NCBvs1BdNrAZBXm/V5+ICNR1 4PuJs2oscnk2307Mazn94u4FVCBVKFUMTGNJOpWSLo10GnkZ3OE6RfhXGafs72W7l5tXiDF+d spYwLR0cJC/Zy5AH2AbmDtmWY9hmuR+Q/amGbg== Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.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 Acked-by: Geert Uytterhoeven Reviewed-by: Frank Rowand --- 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 without replay. 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 4a8a70916237..1efdbe53136c 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -735,6 +735,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) {