Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752737AbbETGKw (ORCPT ); Wed, 20 May 2015 02:10:52 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:7267 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751962AbbETGKu (ORCPT ); Wed, 20 May 2015 02:10:50 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Tue, 19 May 2015 23:08:00 -0700 From: Alexandre Courbot To: Ben Skeggs , David Airlie , Arnd Bergmann CC: Thierry Reding , , , , , Alexandre Courbot Subject: [PATCH] drm/nouveau/platform: fix compilation if !CONFIG_IOMMU Date: Wed, 20 May 2015 15:10:24 +0900 Message-ID: <1432102224-15169-1-git-send-email-acourbot@nvidia.com> X-Mailer: git-send-email 2.4.0 In-Reply-To: <555BD66A.5020704@nvidia.com> References: <555BD66A.5020704@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1742 Lines: 56 The lack of IOMMU API support can make nouveau_platform_probe_iommu() fail to compile because struct iommu_ops is then empty. Fix this by skipping IOMMU probe in that case - lack of IOMMU on platform devices is sub-optimal, but is not an error. Signed-off-by: Alexandre Courbot --- This is an alternative to https://lkml.org/lkml/2015/5/19/484. Most users of Nouveau do not care about IOMMU support, so we should not impose that option on them. drm/nouveau/nouveau_platform.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_platform.c b/drivers/gpu/drm/nouveau/nouveau_platform.c index 775277f1edb0..dcfbbfaf1739 100644 --- a/drivers/gpu/drm/nouveau/nouveau_platform.c +++ b/drivers/gpu/drm/nouveau/nouveau_platform.c @@ -92,6 +92,8 @@ static int nouveau_platform_power_down(struct nouveau_platform_gpu *gpu) return 0; } +#if IS_ENABLED(CONFIG_IOMMU_API) + static void nouveau_platform_probe_iommu(struct device *dev, struct nouveau_platform_gpu *gpu) { @@ -158,6 +160,20 @@ static void nouveau_platform_remove_iommu(struct device *dev, } } +#else + +static void nouveau_platform_probe_iommu(struct device *dev, + struct nouveau_platform_gpu *gpu) +{ +} + +static void nouveau_platform_remove_iommu(struct device *dev, + struct nouveau_platform_gpu *gpu) +{ +} + +#endif + static int nouveau_platform_probe(struct platform_device *pdev) { struct nouveau_platform_gpu *gpu; -- 2.4.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/