diff options
author | Varun Sethi <Varun.Sethi@freescale.com> | 2013-07-12 13:08:24 (GMT) |
---|---|---|
committer | Andy Fleming <afleming@freescale.com> | 2013-07-24 20:12:25 (GMT) |
commit | 73bb227c5209e11f8fc1c2d27282c53b19440d72 (patch) | |
tree | f107dd41f43b79e34a3df907bba33b8609fb57bd /drivers | |
parent | 061a2a18b26b9381af9f69a739a0fb3e6cfb2a12 (diff) | |
download | linux-fsl-qoriq-73bb227c5209e11f8fc1c2d27282c53b19440d72.tar.xz |
Put the PCI specific code in the PAMU driver under CONFIG_PCI.
This fixes the problem where the kernel build breaks, when PCI
support is disabled.
Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iommu/fsl_pamu_domain.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index 4575e63..5b54505 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -691,6 +691,7 @@ static int fsl_pamu_attach_device(struct iommu_domain *domain, const u32 *liodn; u32 liodn_cnt; int len, ret = 0; +#ifdef CONFIG_PCI struct pci_dev *pdev = NULL; struct pci_controller *pci_ctl; @@ -708,6 +709,7 @@ static int fsl_pamu_attach_device(struct iommu_domain *domain, */ dev = pci_ctl->parent; } +#endif liodn = of_get_property(dev->of_node, "fsl,liodn", &len); if (liodn) { @@ -729,6 +731,7 @@ static void fsl_pamu_detach_device(struct iommu_domain *domain, struct fsl_dma_domain *dma_domain = domain->priv; const u32 *prop; int len; +#ifdef CONFIG_PCI struct pci_dev *pdev = NULL; struct pci_controller *pci_ctl; @@ -746,6 +749,7 @@ static void fsl_pamu_detach_device(struct iommu_domain *domain, */ dev = pci_ctl->parent; } +#endif prop = of_get_property(dev->of_node, "fsl,liodn", &len); if (prop) @@ -901,12 +905,6 @@ static int fsl_pamu_get_domain_attr(struct iommu_domain *domain, return ret; } -static void swap_pci_ref(struct pci_dev **from, struct pci_dev *to) -{ - pci_dev_put(*from); - *from = to; -} - static struct iommu_group *get_device_iommu_group(struct device *dev) { struct iommu_group *group; @@ -918,6 +916,13 @@ static struct iommu_group *get_device_iommu_group(struct device *dev) return group; } +#ifdef CONFIG_PCI +static void swap_pci_ref(struct pci_dev **from, struct pci_dev *to) +{ + pci_dev_put(*from); + *from = to; +} + static bool check_pci_ctl_endpt_part(struct pci_controller *pci_ctl) { u32 version; @@ -1014,12 +1019,14 @@ static struct iommu_group *get_pci_device_group(struct pci_dev *pdev) return group; } +#endif static int fsl_pamu_add_device(struct device *dev) { struct iommu_group *group = NULL; - struct pci_dev *pdev; int ret; +#ifdef CONFIG_PCI + struct pci_dev *pdev; /* * For platform devices we allocate a separate group for @@ -1034,6 +1041,7 @@ static int fsl_pamu_add_device(struct device *dev) group = get_pci_device_group(pdev); } else +#endif group = get_device_iommu_group(dev); if (!group || IS_ERR(group)) @@ -1108,8 +1116,9 @@ static u32 fsl_pamu_get_windows(struct iommu_domain *domain) static struct iommu_domain *fsl_get_dev_domain(struct device *dev) { - struct pci_controller *pci_ctl; struct device_domain_info *info; +#ifdef CONFIG_PCI + struct pci_controller *pci_ctl; struct pci_dev *pdev; /* @@ -1127,6 +1136,7 @@ static struct iommu_domain *fsl_get_dev_domain(struct device *dev) */ dev = pci_ctl->parent; } +#endif info = dev->archdata.iommu_domain; if (info && info->domain) @@ -1162,7 +1172,9 @@ int pamu_domain_init() return ret; bus_set_iommu(&platform_bus_type, &fsl_pamu_ops); +#ifdef CONFIG_PCI bus_set_iommu(&pci_bus_type, &fsl_pamu_ops); +#endif return ret; } |