Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751619AbdIKUIa (ORCPT ); Mon, 11 Sep 2017 16:08:30 -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 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: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1365 Lines: 37 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(+) 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, -- 2.9.0