Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mcb: Add a dma_device to mcb_device

When performing DMA operations on a MCB device, the device needed
for using the DMA API is "mcb_device->bus_carrier".
This is rather lengthy, so a shortcut is introduced to struct mcb_device
in order to ensure the MCB device driver uses the correct device for DMA
operations.

Signed-off-by: Michael Moese <michael.moese@men.de>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Michael Moese and committed by
Greg Kroah-Hartman
2d8784df 15bb81d3

+2
+1
drivers/mcb/mcb-core.c
··· 233 233 dev->dev.bus = &mcb_bus_type; 234 234 dev->dev.parent = bus->dev.parent; 235 235 dev->dev.release = mcb_release_dev; 236 + dev->dma_dev = bus->carrier; 236 237 237 238 device_id = dev->id; 238 239 dev_set_name(&dev->dev, "mcb%d-16z%03d-%d:%d:%d",
+1
include/linux/mcb.h
··· 76 76 int rev; 77 77 struct resource irq; 78 78 struct resource mem; 79 + struct device *dma_dev; 79 80 }; 80 81 81 82 static inline struct mcb_device *to_mcb_device(struct device *dev)