drm/tegra: vic: Fix implicit function declaration warning

When CONFIG_IOMMU_API isn't set the following warnings pops up:

drivers/gpu/drm/tegra/vic.c: In function ‘vic_boot’:
drivers/gpu/drm/tegra/vic.c:110:31: error: implicit declaration of function ‘dev_iommu_fwspec_get’; did you mean ‘iommu_fwspec_free’? [-Werror=implicit-function-declaration]
   struct iommu_fwspec *spec = dev_iommu_fwspec_get(vic->dev);
                               ^~~~~~~~~~~~~~~~~~~~
                               iommu_fwspec_free
drivers/gpu/drm/tegra/vic.c:110:31: warning: initialization of ‘struct iommu_fwspec *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
drivers/gpu/drm/tegra/vic.c:117:19: error: ‘struct iommu_fwspec’ has no member named ‘num_ids’
   if (spec && spec->num_ids > 0) {
                   ^~
drivers/gpu/drm/tegra/vic.c:118:16: error: ‘struct iommu_fwspec’ has no member named ‘ids’
    value = spec->ids[0] & 0xffff;
                ^~

Rework so that its inside a '#ifdef CONFIG_IOMMU_API' block.

Fixes: f3779cb190 ("drm/tegra: vic: Support stream ID register programming")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
Anders Roxell 2019-02-18 12:00:50 +01:00 committed by Thierry Reding
parent 7cf77b273a
commit 509869a2fe
1 changed files with 2 additions and 0 deletions

View File

@ -106,6 +106,7 @@ static int vic_boot(struct vic *vic)
if (vic->booted) if (vic->booted)
return 0; return 0;
#ifdef CONFIG_IOMMU_API
if (vic->config->supports_sid) { if (vic->config->supports_sid) {
struct iommu_fwspec *spec = dev_iommu_fwspec_get(vic->dev); struct iommu_fwspec *spec = dev_iommu_fwspec_get(vic->dev);
u32 value; u32 value;
@ -121,6 +122,7 @@ static int vic_boot(struct vic *vic)
vic_writel(vic, value, VIC_THI_STREAMID1); vic_writel(vic, value, VIC_THI_STREAMID1);
} }
} }
#endif
/* setup clockgating registers */ /* setup clockgating registers */
vic_writel(vic, CG_IDLE_CG_DLY_CNT(4) | vic_writel(vic, CG_IDLE_CG_DLY_CNT(4) |