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: 112235 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4270435qgf; Mon, 11 Sep 2017 13:08:24 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4m5T79AtxqSyxk8kDflJFq3w4yeYRSdgLKfrj3NZuL5LeAgTrbOTcLfKeLuTy0zHNkLy89 X-Received: by 10.36.181.22 with SMTP id v22mr14279202ite.139.1505160504927; Mon, 11 Sep 2017 13:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505160504; cv=none; d=google.com; s=arc-20160816; b=oERokMY+jzf27eDqUKdOld2rlvJZQIFeJx3CBTyqDmIdt0q8sUoOH1sCE+GUSASDIQ rfaoowSX3+WHhG/or+Fj9UQ3TR1ApVrT+LnNBbHBbWw4HefU7rzpl2RjldgypVDYVA0h 6hMcL3ySPxgzzfoVsw7KuFKgk9KOR8V44bNJcFOrSYU2yjWjd4o0cqmq0ZWTjdlvmfu0 CWiA686cQheyNjnb1iwBSznMW08sQoroUTdbj7T0n3P8lck9gVO0vgzmoDi1d5uJF474 FZ4rf5kj27GngIxGBFkEAg1Ky9xbcHrV1+9S61zXrn4G0RJ6GQ/LvINDLLt0eVz+6Qq7 w9Ew== 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=lwMh79sTsKh9bozKZ9IpzEHHKr7MzjSvfzLvP9BG5hQ=; b=Np7RnbXMMmSgzAgD2gdiK3w/8cJHnzypkMQcjeqYhKo1OuxWDZ7L6vR2INzKT8qg3+ ho5pzRO+EqIoZIXcQitR/j/fOdYKHolSBAhGI/lce7Ftq8qk1LhYsrUF0ycItS2a5SUy fR6JbMxgKS2Sv+b0QWw39mokE9Trf6uii099vQRE+uH6z/fPrJvjup76M30rkCmbBfkW p6A2YMwbTJJF42aMX5pc2iouth5Wj3ojhQFzRmJOkWPatF1nE0UFuD5683NofVGdAvNL 2macQujEnt1qFc70PRTWCTTsjfs6VWb+ssZ7G4YGAEk9F95XvmMJRlp7lExoB0McbfJV 3u8Q== 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 c9si9321191iti.137.2017.09.11.13.08.24; Mon, 11 Sep 2017 13:08:24 -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 S1751559AbdIKUIX (ORCPT + 6 others); 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: 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 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(+) -- 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 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) {