Skip to contentSkip to conversation

ssb: add dma_dev to ssb_device structure

PATCH New [email protected] 1 participant 1 message Jun 4, 2010 Sonics silicon backplane driver (ssb)

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 ssb: add dma_dev to ssb_device structure

From: FUJITA Tomonori <[email protected]>

Add dma_dev, a pointer to struct device, to struct ssb_device. We pass it to the generic DMA API with SSB_BUSTYPE_PCI and SSB_BUSTYPE_SSB. ssb_devices_register() sets up it properly.

This is preparation for replacing the ssb bus specific DMA API (ssb_dma_*) with the generic DMA API.

---

 drivers/ssb/main.c      |    2 ++
 include/linux/ssb/ssb.h |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/ssb/main.c renamed from drivers/ssb/main.c~ssb-add-dma_dev-to-ssb_device-structure +2 -0
diff -puN drivers/ssb/main.c~ssb-add-dma_dev-to-ssb_device-structure drivers/ssb/main.c
@@ -486,6 +486,7 @@ static int ssb_devices_register(struct s
 #ifdef CONFIG_SSB_PCIHOST
 			sdev->irq = bus->host_pci->irq;
 			dev->parent = &bus->host_pci->dev;
+			sdev->dma_dev = dev->parent;
 #endif
 			break;
 		case SSB_BUSTYPE_PCMCIA:
@@ -501,6 +502,7 @@ static int ssb_devices_register(struct s
 			break;
 		case SSB_BUSTYPE_SSB:
 			dev->dma_mask = &dev->coherent_dma_mask;
+			sdev->dma_dev = dev;
 			break;
 		}
 
include/linux/ssb/ssb.h renamed from include/linux/ssb/ssb.h~ssb-add-dma_dev-to-ssb_device-structure +1 -1
diff -puN include/linux/ssb/ssb.h~ssb-add-dma_dev-to-ssb_device-structure include/linux/ssb/ssb.h
@@ -167,7 +167,7 @@ struct ssb_device {
 	 * is an optimization. */
 	const struct ssb_bus_ops *ops;
 
-	struct device *dev;
+	struct device *dev, *dma_dev;
 
 	struct ssb_bus *bus;
 	struct ssb_device_id id;

_