diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2016-02-03 06:46:34 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-03-02 16:01:56 +0100 |
commit | e82becfc1879a43aa29492ae90ea6eb6c68b60fc (patch) | |
tree | 58a5bb902a9ee27cf0a4242ba3fcdf86fa60a315 /arch/s390/include/asm/dma-mapping.h | |
parent | alpha/dma: use common noop dma ops (diff) | |
download | linux-e82becfc1879a43aa29492ae90ea6eb6c68b60fc.tar.xz linux-e82becfc1879a43aa29492ae90ea6eb6c68b60fc.zip |
s390/dma: Allow per device dma ops
As virtio-ccw will have dma ops, we can no longer default to the
zPCI ones. Make use of dev_archdata to keep the dma_ops per device.
The pci devices now use that to override the default, and the
default is changed to use the noop ops for everything that does not
specify a device specific one.
To compile without PCI support we will enable HAS_DMA all the time,
via the default config in lib/Kconfig.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Joerg Roedel <jroedel@suse.de>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'arch/s390/include/asm/dma-mapping.h')
-rw-r--r-- | arch/s390/include/asm/dma-mapping.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/s390/include/asm/dma-mapping.h b/arch/s390/include/asm/dma-mapping.h index e64bfcb9702f..3249b7464889 100644 --- a/arch/s390/include/asm/dma-mapping.h +++ b/arch/s390/include/asm/dma-mapping.h @@ -11,11 +11,13 @@ #define DMA_ERROR_CODE (~(dma_addr_t) 0x0) -extern struct dma_map_ops s390_dma_ops; +extern struct dma_map_ops s390_pci_dma_ops; static inline struct dma_map_ops *get_dma_ops(struct device *dev) { - return &s390_dma_ops; + if (dev && dev->archdata.dma_ops) + return dev->archdata.dma_ops; + return &dma_noop_ops; } static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |