summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@sandisk.com>2017-01-20 13:04:36 -0800
committerDoug Ledford <dledford@redhat.com>2017-01-24 12:26:17 -0500
commit99db9494035f5b9fbb1d579f89c6fa1beba6dbb7 (patch)
treeae9fbb5059c019095aad90b8600823bc25344238 /drivers
parent92f4ae3559832ef1e5f785cfea14c231ef40612e (diff)
IB/core: Remove ib_device.dma_device
Add code in ib_register_device() for copying the DMA masks. Use &ib_device.dev in DMA mapping operations instead of dma_device. Remove ib_device.dma_device because due to this and previous patches it is no longer used. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/core/device.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index d543c4390447..cac1518de36e 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -333,14 +333,15 @@ int ib_register_device(struct ib_device *device,
int ret;
struct ib_client *client;
struct ib_udata uhw = {.outlen = 0, .inlen = 0};
-
- WARN_ON_ONCE(!device->dev.parent && !device->dma_device);
- WARN_ON_ONCE(device->dev.parent && device->dma_device
- && device->dev.parent != device->dma_device);
- if (!device->dev.parent)
- device->dev.parent = device->dma_device;
- if (!device->dma_device)
- device->dma_device = device->dev.parent;
+ 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);