]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/infiniband/core/device.c
Merge tag 'for-next-dma_ops' of git://git.kernel.org/pub/scm/linux/kernel/git/dledfor...
[mirror_ubuntu-bionic-kernel.git] / drivers / infiniband / core / device.c
index f2e48655a906bbe16d0923905288e8fbf6af6e35..a63e8400ea3b0c9e964b54140edd4f1fd758b47d 100644 (file)
@@ -333,6 +333,15 @@ int ib_register_device(struct ib_device *device,
        int ret;
        struct ib_client *client;
        struct ib_udata uhw = {.outlen = 0, .inlen = 0};
+       struct device *parent = device->dev.parent;
+
+       WARN_ON_ONCE(!parent);
+       if (!device->dev.dma_ops)
+               device->dev.dma_ops = parent->dma_ops;
+       if (!device->dev.dma_mask)
+               device->dev.dma_mask = parent->dma_mask;
+       if (!device->dev.coherent_dma_mask)
+               device->dev.coherent_dma_mask = parent->coherent_dma_mask;
 
        mutex_lock(&device_mutex);