From 99db9494035f5b9fbb1d579f89c6fa1beba6dbb7 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 20 Jan 2017 13:04:36 -0800 Subject: 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 Signed-off-by: Doug Ledford --- drivers/infiniband/core/device.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'drivers/infiniband/core/device.c') 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); -- cgit v1.2.3-59-g8ed1b