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) { From patchwork Mon Sep 11 20:07: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: 112236 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4270530qgf; Mon, 11 Sep 2017 13:08:31 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7lfHdaYc402gR0p+VX6yGHcx2DSXs9OWMul9q2yuW5PMOrRk0bZOzKUbwM+jKHWzGjRyGh X-Received: by 10.36.0.215 with SMTP id 206mr14494507ita.84.1505160511250; Mon, 11 Sep 2017 13:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505160511; cv=none; d=google.com; s=arc-20160816; b=tcXtVAhNUnYC6MSwHl3OfKaSWGr1VpYOGg1Ve1iiU6tl0XSjii7uq+25r6IGi3Av1E 8C6AUGRVAvYtFvEC5PMt68hFK504kqSAUspiAaxyBvodzcWFjh8GJ60IOWJxkmRYk9tD LRvGYGjsu9xCFyv4ktKsNu11W6ZiAJ/UhHhHpRyX19yq/4I4eSoCOupGvBaYbYoesgQl nPXSe7iz3hxfpGB9iJbH0JRPX8ez88muV/0rJo1vfIu3LpbquRXlC/sNmEHbad0KEtpy hhynR7nP6/8gLpQ73yBFGqJYjAZuys3qyJ6zEXybQiOy8VpHeUusXtrCGLUsYZQptGqA MHPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=AspBoOxWWP9x3vKqLGT0N9g9ZPE0YqRxoUal7ZW9aKQ=; b=bDxKStxqcFWwYuiff/gn3FzRo5x5CHqypnbd3t6Ycgr/IMefBx33Z+X+X9wECtU6kj my8W782UufgxpQ8TcRww87VbDLutZh5dfwugTDlCOWmzEhxeJMqhaEk8fltYzqheupWn 6VOJQahwchPyRUM04UciKlklUSQ4bZd4baTLRS0h5Ah/FFBvo0CniMiDVamj0jUoFGKQ n6DD7x9X+CVS7tjP0WsA5aJLtageFe57+GX0LxdBCyvHWcSEoi8uNTQ43kXoteTMsyqP ZUTMhMy35Ga5sjGQhSNEjy6Y/v9Ejl/dm/8OEPOqnPX8Mpexv+XMdLh8YjLnQIf0hV0P vq5g== 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 204si132342itd.98.2017.09.11.13.08.31; Mon, 11 Sep 2017 13:08:31 -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 S1751589AbdIKUI3 (ORCPT + 6 others); Mon, 11 Sep 2017 16:08:29 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:57038 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751548AbdIKUI0 (ORCPT ); Mon, 11 Sep 2017 16:08:26 -0400 Received: from wuerfel.lan ([95.208.190.237]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MJTL9-1dtPsk1dlL-003638; Mon, 11 Sep 2017 22:08:21 +0200 From: Arnd Bergmann To: Andrew Morton , Rob Herring , Frank Rowand Cc: Arnd Bergmann , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] of: provide inline helper for of_find_device_by_node Date: Mon, 11 Sep 2017 22:07:50 +0200 Message-Id: <20170911200805.3363318-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170911200805.3363318-1-arnd@arndb.de> References: <20170911200805.3363318-1-arnd@arndb.de> X-Provags-ID: V03:K0:8C38mNB2Fqe6GhCiOl5rneTGn9g/JAIm1kIyi3gS583+q3XoLGD H1T9hNmMxqKluXaWAQXXqXCAwRJvOZMHInTJh07r+ajYuv839c+bRisdUFUujlWXxbx0f1R e5g4IL9FZN5lQPttClk9ybO5UzFC0tlyFxStQF0mZDy0ppaDGB439ML+Kjg3WlhPheARCrM plvB9fSno5Ojj/5q5GLEw== X-UI-Out-Filterresults: notjunk:1; V01:K0:fyItPodCc7A=:3KX7vB3LJgObHmECsLsQrL suCUabBENWSJp/b7R66B3ATRw5wsdW/1Bi96fW045RT1LPoJct0KNNJlZcBpqycz7YHQym87x +X7jDe6Yu4IvIdGvsIIeZ8oW9FNlczJTFSuq/rM7MJFGfo81Tl13qb78q/PHdJG/GumIeg9Nd +6LxPFW+vgqSeG2mWyddHtALOhFodwkyz86pN4jC4HgKc72VcuUC1fHte9ypbendF6YqpdVIB EEnqtsQ/lcLF4he6nGhXs/nk6onjPP1sycnifbMIub3jPgZbAeCi0D6iMw8ewWMI968v0C6P4 E7FwPRPFsBsTLpu4y41pYMMqP5XjJUsxQWjIpqgd2WakkjS3v08F2ngXHZPz1l8MEZorCwz5f jnNrLi41Y5I96NlJZiBxkPLsPidS+CshD6jw0rLKuEshEqiHKwgT7P72moDe7X6M6FpqO5CJZ QWVuV2WjFZUjPXWktXqndup2KhC4rUYriPTQRFJEGiNqMt/Y3hcl8Hwx+0q51SKwRshkY0mYl Blc/FhRMkT02oiG/cX5VXXIHG8GanZEcmRuhvDfXyYZTqrToTcUXZkqf3jXTk2ABojts6nRiR bhaJWzy/JUrhheooDhqYgWjXiFMIUI/hmGmb0YcE8YIMizmdViWaARtYoYcVul3yPtNpK2QUr wvVOZC2AIOWvmjW1t7pf5DGO56Rybs6gz8+02Rw1abRndImnI2f7QFkWNfvPNu9exxWJB9Fn0 M+xv0gflynCtpIwVmPiT0jNOk94TVAGpjiKLnw== Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The ipmmu-vmsa driver fails in compile-testing on non-OF platforms: drivers/iommu/ipmmu-vmsa.o: In function `ipmmu_of_xlate': ipmmu-vmsa.c:(.text+0x740): undefined reference to `of_find_device_by_node' It would be reasonable to assume that this interface works but returns failure on non-OF builds, like it does on machines that have been booted in another way, so this adds another inline function helper. Fixes: 7b2d59611fef ("iommu/ipmmu-vmsa: Replace local utlb code with fwspec ids") Signed-off-by: Arnd Bergmann --- include/linux/of_platform.h | 7 +++++++ 1 file changed, 7 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_platform.h b/include/linux/of_platform.h index e0d1946270f3..fb908e598348 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -57,7 +57,14 @@ extern const struct of_device_id of_default_bus_match_table[]; extern struct platform_device *of_device_alloc(struct device_node *np, const char *bus_id, struct device *parent); +#ifdef CONFIG_OF extern struct platform_device *of_find_device_by_node(struct device_node *np); +#else +static inline struct platform_device *of_find_device_by_node(struct device_node *np) +{ + return NULL; +} +#endif /* Platform devices and busses creation */ extern struct platform_device *of_platform_device_create(struct device_node *np,