From patchwork Tue Mar 15 21:37:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102568 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp933186lbc; Tue, 15 Mar 2016 14:38:54 -0700 (PDT) X-Received: by 10.98.13.77 with SMTP id v74mr422987pfi.162.1458077933996; Tue, 15 Mar 2016 14:38:53 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m21si70402pfi.38.2016.03.15.14.38.53; Tue, 15 Mar 2016 14:38:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753680AbcCOViw (ORCPT + 31 others); Tue, 15 Mar 2016 17:38:52 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:63411 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752417AbcCOVis (ORCPT ); Tue, 15 Mar 2016 17:38:48 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0Le4eS-1a1Aqg0zBU-00psuO; Tue, 15 Mar 2016 22:38:06 +0100 From: Arnd Bergmann Cc: Yong Wu , Robin Murphy , Arnd Bergmann , Matthias Brugger , Joerg Roedel , Alex Williamson , Will Deacon , Magnus Damm , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH] iommu: provide of_xlate pointer unconditionally Date: Tue, 15 Mar 2016 22:37:17 +0100 Message-Id: <1458077877-474066-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:MzuAUmxvC3OaLZnF/OAsB/5+4/MLxqgwOUTM5jl2dE0a71RJbUU hCytWidlO0cfNig3mysAfVSKQdCgq45Ti4NxX1W5fDD6t/urhYvWlx0muq2GvG/V7lX3AiM NZFJsYzLoWI7cxWqahKpc8NW3vUo3AIoY7aQWBSTM1oM+z8pN/qdGGDEXJwkkCEVxKIqd2N uS6wgFwxnOEeJDgf/zG6A== X-UI-Out-Filterresults: notjunk:1; V01:K0:cRPDk3YhLpk=:T5WiQSoB6AhlpgSTQHmeVn Nnrh8xGUJwsrYlcPDK/y0r38ZDGFzhir87jbzY+8MbddP1PQZQJ+yUzN6eZ5/UKmEE6Ps8p+k 0Yjbgye5pQYC+2We65kjsOX8VDlLiD1+hwRy2YnSjnPfAf05feX+ITzTIUs+cWTkmoRemKETL RwkGbQqgkBahE0ruVhucdUOLLFaJDfTWWaSbzxnWh84mT4yCtCgMiSo4rNHery/1SHTdTO3l4 UQt2s34qbwXJsnlze64l1oOvzFOciNF9cuzN0/pRqFYeJ/tKAC8W83bdVcLYGLU5cGvdG+Am9 G6bbOVOywrv4bHT3yOshdQM/UHxId+ADVHLyBv/hxm7EKrN3Btif0IPKX2moYmyOoU7U1PwYa 1AxW2F2Y1YrHhVLf0fUKLpXgCcukBcHbeq+qSrCVgosheER3K4F+L77qTigCzCp/09LBcdKDp wQYHmYa7Wu1e5pp/L/5bHZvrOniEjJNxxdgf4OHVP5jtCa1CBFnyvAjTgq32mwnfCluEFvkuW JKVm/1Dv990pmK+KxTtt+m8cinCnDZoQReEmYxXG3fxW3TtmoPUgq4OiGE/I26d+/AYMqbV9e YzQYq6XGykKerzNheMjNUF70ZL1ennzF4PCFyj7aRv1Z8Qk04QCyjnhN3wPQ5EzFawt2ltS2f 6VIP1DICyckeI13IWsUv5dFeRUX6oJG+dvH1SWGucfzGeSsDGPv0g6w9xnMJbjf7HFF8= To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org iommu drivers that support the standard DT bindings use a of_xlate callback pointer, but that is only part of struct iommu_ops when CONFIG_OF_IOMMU is enabled, leading to build errors in randconfig builds when that is not provided: drivers/iommu/mtk_iommu.c:497:2: error: unknown field 'of_xlate' specified in initializer .of_xlate = mtk_iommu_of_xlate, ^ drivers/iommu/mtk_iommu.c:497:14: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] .of_xlate = mtk_iommu_of_xlate, ^~~~~~~~~~~~~~~~~~ drivers/iommu/mtk_iommu.c:497:14: note: (near initialization for 'mtk_iommu_ops.domain_get_attr') We can work around it by adding more #ifdefs in each driver, but it seems nicer to just allow setting the pointer even if it is unused. This makes the driver code look nicer, and it gives better compile-time coverage when test building on other architectures. Signed-off-by: Arnd Bergmann Fixes: 0df4fabe208d ("iommu/mediatek: Add mt8173 IOMMU driver") --- include/linux/iommu.h | 2 -- 1 file changed, 2 deletions(-) -- 2.7.0 diff --git a/include/linux/iommu.h b/include/linux/iommu.h index a5c539fa5d2b..ef7a6ecd8584 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -195,9 +195,7 @@ struct iommu_ops { /* Get the number of windows per domain */ u32 (*domain_get_windows)(struct iommu_domain *domain); -#ifdef CONFIG_OF_IOMMU int (*of_xlate)(struct device *dev, struct of_phandle_args *args); -#endif unsigned long pgsize_bitmap; void *priv;