diff options
author | Joerg Roedel <jroedel@suse.de> | 2015-10-21 23:51:38 +0200 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2015-10-22 00:00:49 +0200 |
commit | 6eab556a40384de94c2d03c8d9d632e5154367f5 (patch) | |
tree | c1a50c01363688c5b974317e34f0f90baee7889d /drivers/iommu/iommu.c | |
parent | 5e62292bad10cff25ff75d136c54e62b43bfb0fa (diff) | |
download | op-kernel-dev-6eab556a40384de94c2d03c8d9d632e5154367f5.zip op-kernel-dev-6eab556a40384de94c2d03c8d9d632e5154367f5.tar.gz |
iommu: Add generic_device_group() function
This function can be used as a device_group call-back and
just allocates one iommu-group per device.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/iommu.c')
-rw-r--r-- | drivers/iommu/iommu.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index fdea700..a80c9c5 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -728,6 +728,21 @@ static int get_pci_alias_or_group(struct pci_dev *pdev, u16 alias, void *opaque) } /* + * Generic device_group call-back function. It just allocates one + * iommu-group per device. + */ +struct iommu_group *generic_device_group(struct device *dev) +{ + struct iommu_group *group; + + group = iommu_group_alloc(); + if (IS_ERR(group)) + return NULL; + + return group; +} + +/* * Use standard PCI bus topology, isolation features, and DMA alias quirks * to find or create an IOMMU group for a device. */ |