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: 108506 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1231992qge; Fri, 21 Jul 2017 13:21:05 -0700 (PDT) X-Received: by 10.98.27.65 with SMTP id b62mr3082574pfb.258.1500668465605; Fri, 21 Jul 2017 13:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500668465; cv=none; d=google.com; s=arc-20160816; b=BFChwcLbBTDvGfhJBqzLwsLVvtghwO0h0IfiLYYupG2dO5AF7D8Xx+BXiUZUp0nkZn stVUifSx3rY9KkwJoYj7NMWa42IM53sJ+zSOP1BdDKmcbUugdOPWb2uSa3g1aUmpOXwL 5At5QmJcgmGK1NGmZLfYFyw0FJhxA3vVsdxzpt4CWg2wHnMZS+0dA85xRQlOvS5NnfDF b0CaORLUSWRUDmWZKdBq6EEe0tbn9aVulZ5ai2xx2V3zP0H/yL/Y0oEYlNF6ppYM4g4l YtRiJakO/O7OMYraT4ShnVdkvjulluveyFdIe85RvLKjFlm9TbShFPugifQzwOtmnDse iRCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=fGrvzut0nNXVEqwGbbXENHm79w7Y+yVpNs4SSJ0J5XE=; b=iMtYSUfl+8wltoFGLmiDI5PWqaRTq+ZH1pExkvL5I/HcIvCL6+20l+q756eCEOWQu/ lNEFpbHJsUWHHmq8pp/C9ZeOWOI913jBKiTlbR5gEs39NwroWD1Nlm6Js6noJmGlPvn2 HlECR+lR1wSSdpWOColKxOzcDL0q3DnT72MzfWxzqyifJznpoMbffUv/CyJ1mlj8CZlS Wk3dDDmSgsm0VVzSfDwP72/+qcLqeE6UeInKd3EyoPZuFwjKkHKWQw1fAjUL6Bng/r2k Q9RPKaL+PU4Ml4tO8C9hkDi5d+e52xyq4ULvHy1dQPkReKtwgXrVlW1oKZyIHxhm5xP9 wYnA== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8si722645pgw.876.2017.07.21.13.21.05; Fri, 21 Jul 2017 13:21:05 -0700 (PDT) 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 S1754687AbdGUUVE (ORCPT + 7 others); 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: 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. 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(+) -- 2.9.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 Reviewed-by: Frank Rowand 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) {