diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2013-10-09 18:56:33 +0200 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2013-10-09 18:56:33 +0200 |
commit | eb1ddc00b81cb8cb23891b6c7c5fbfaea29f3c73 (patch) | |
tree | 19cef10472e84e085d51068fdff191749c829a78 /drivers/xen/swiotlb-xen.c | |
parent | xen/arm,arm64: enable SWIOTLB_XEN (diff) | |
download | linux-eb1ddc00b81cb8cb23891b6c7c5fbfaea29f3c73.tar.xz linux-eb1ddc00b81cb8cb23891b6c7c5fbfaea29f3c73.zip |
swiotlb-xen: introduce xen_swiotlb_set_dma_mask
Implement xen_swiotlb_set_dma_mask, use it for set_dma_mask on arm.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'drivers/xen/swiotlb-xen.c')
-rw-r--r-- | drivers/xen/swiotlb-xen.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index f0fc1a4f565a..d8ef0bf577d2 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -608,3 +608,15 @@ xen_swiotlb_dma_supported(struct device *hwdev, u64 mask) return xen_virt_to_bus(xen_io_tlb_end - 1) <= mask; } EXPORT_SYMBOL_GPL(xen_swiotlb_dma_supported); + +int +xen_swiotlb_set_dma_mask(struct device *dev, u64 dma_mask) +{ + if (!dev->dma_mask || !xen_swiotlb_dma_supported(dev, dma_mask)) + return -EIO; + + *dev->dma_mask = dma_mask; + + return 0; +} +EXPORT_SYMBOL_GPL(xen_swiotlb_set_dma_mask); |