Skip to content

Commit

Permalink
drm/nouveau/platform: fix compile error if !CONFIG_IOMMU
Browse files Browse the repository at this point in the history
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 <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Alexandre Courbot authored and Ben Skeggs committed Jul 27, 2015
1 parent f5654d9 commit a67e14b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions drivers/gpu/drm/nouveau/nouveau_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a67e14b

Please sign in to comment.