From patchwork Fri Jul 21 21:09:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108513 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1277353qge; Fri, 21 Jul 2017 14:10:29 -0700 (PDT) X-Received: by 10.84.174.4 with SMTP id q4mr580863plb.235.1500671429241; Fri, 21 Jul 2017 14:10:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500671429; cv=none; d=google.com; s=arc-20160816; b=bu9Xk0y7W3YDJYTkKNa3YgaWJXHy8XO87btMesECquUV7BzgCivDHQuV71qppmlE5Q UEvh5tRCD9HORNcZu0fD7sHvJYTM2rXiLXnvbEZp+wEwn4wUen1PJQsItlcqeR0KMGUi XlmRXmEE1rYgtndNjM4QbbN7VFPmvfPQvG4MSxL7L99altPvLOn3tqObPu/hy+9lvoiO Zwy1y4jjrfDIq5qlfK5UOk5XxfsJyXijtoLkRl7ycSbdE7ErxUvmbYJGTiEgt+PNLTJg ujt7HS6va2BRlI2nf0riQU/cMxeQymocYlaKYj4m5G871RCLfvKcfUAXi6VcjXHyxC50 pvxQ== 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=l8A4g0Ot+PDJeJ3b2l48T6S0Cns4YLOh29RUVp5c6bY=; b=nPmKKYSloEMbHf4L4xJhmJWyO3qNUBV+Fn6VttAz4lcFnXi+cQfrRAjj+P7pOsHG4n o+oANNaFHcWGb3Ge1swHH1rmKspb+nhLSIYjgdilag7YWwgOhJdLGyQyu+yQdDLVGugA sRwihAaOkB6sVnswK9WqSp4eXJ39CJTianl6W+OLdPoD/hjfeSdcnbUEsrGkPYa97Cx5 MtuJGrkX5jV1//130PIHTvkBtoVy9Kg+cpodKQFfONf8os3PKWu6pUG6CDFN86FRYTFQ VABvXj3HqgP1XdRmtzNK9LKb7mEIxvwHkkCryhJB6uAZjEcl/C0C2824QuWQKu5JNQVG CupQ== 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 p5si3523818pgj.277.2017.07.21.14.10.28; Fri, 21 Jul 2017 14:10:29 -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 S1753516AbdGUVK1 (ORCPT + 7 others); Fri, 21 Jul 2017 17:10:27 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:58267 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752091AbdGUVK0 (ORCPT ); Fri, 21 Jul 2017 17:10:26 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lk8aY-1e9dpN48Ec-00c5Uu; Fri, 21 Jul 2017 23:10:08 +0200 From: Arnd Bergmann To: 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 , Kieran Bingham , Geert Uytterhoeven , Mika Westerberg , Sudeep Holla , Richard Fitzgerald , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] of: provide of_n_{addr, size}_cells wrappers for !CONFIG_OF Date: Fri, 21 Jul 2017 23:09:50 +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cymcCPxhZ4m3gQmgfoAc7UfKKGF6B YhSh+VcO8TT+uUsC0H6LE3UoZ7GZsIOPih6O0A== 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: 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 without reply. It's still broken and I think this is the correct fix. v2: modify changelog as Geert suggested. 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 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) {