Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc/iommu: Move dev_has_iommu_table() to iommu.c

Move function dev_has_iommu_table() to powerpc/kernel/iommu.c
as it is going to be used by machine specific iommu code as
well in subsequent patches.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/171923274748.1397.6274953248403106679.stgit@linux.ibm.com

authored by

Shivaprasad G Bhat and committed by
Michael Ellerman
35146ead 4ba2fdff

+23 -16
+6
arch/powerpc/include/asm/iommu.h
··· 222 222 enum dma_data_direction *direction); 223 223 extern void iommu_tce_kill(struct iommu_table *tbl, 224 224 unsigned long entry, unsigned long pages); 225 + int dev_has_iommu_table(struct device *dev, void *data); 225 226 226 227 #else 227 228 static inline void iommu_register_group(struct iommu_table_group *table_group, ··· 233 232 234 233 static inline int iommu_add_device(struct iommu_table_group *table_group, 235 234 struct device *dev) 235 + { 236 + return 0; 237 + } 238 + 239 + static inline int dev_has_iommu_table(struct device *dev, void *data) 236 240 { 237 241 return 0; 238 242 }
-16
arch/powerpc/kernel/eeh.c
··· 1273 1273 1274 1274 #ifdef CONFIG_IOMMU_API 1275 1275 1276 - static int dev_has_iommu_table(struct device *dev, void *data) 1277 - { 1278 - struct pci_dev *pdev = to_pci_dev(dev); 1279 - struct pci_dev **ppdev = data; 1280 - 1281 - if (!dev) 1282 - return 0; 1283 - 1284 - if (device_iommu_mapped(dev)) { 1285 - *ppdev = pdev; 1286 - return 1; 1287 - } 1288 - 1289 - return 0; 1290 - } 1291 - 1292 1276 /** 1293 1277 * eeh_iommu_group_to_pe - Convert IOMMU group to EEH PE 1294 1278 * @group: IOMMU group
+17
arch/powerpc/kernel/iommu.c
··· 988 988 EXPORT_SYMBOL_GPL(iommu_direction_to_tce_perm); 989 989 990 990 #ifdef CONFIG_IOMMU_API 991 + 992 + int dev_has_iommu_table(struct device *dev, void *data) 993 + { 994 + struct pci_dev *pdev = to_pci_dev(dev); 995 + struct pci_dev **ppdev = data; 996 + 997 + if (!dev) 998 + return 0; 999 + 1000 + if (device_iommu_mapped(dev)) { 1001 + *ppdev = pdev; 1002 + return 1; 1003 + } 1004 + 1005 + return 0; 1006 + } 1007 + 991 1008 /* 992 1009 * SPAPR TCE API 993 1010 */