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,