976-ssb_add_dma_dev.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. From: FUJITA Tomonori <[email protected]>
  2. Add dma_dev, a pointer to struct device, to struct ssb_device. We pass it
  3. to the generic DMA API with SSB_BUSTYPE_PCI and SSB_BUSTYPE_SSB.
  4. ssb_devices_register() sets up it properly.
  5. This is preparation for replacing the ssb bus specific DMA API (ssb_dma_*)
  6. with the generic DMA API.
  7. Signed-off-by: FUJITA Tomonori <[email protected]>
  8. Acked-by: Michael Buesch <[email protected]>
  9. Cc: Gary Zambrano <[email protected]>
  10. Cc: Stefano Brivio <[email protected]>
  11. Cc: Larry Finger <[email protected]>
  12. Cc: John W. Linville <[email protected]>
  13. Acked-by: David S. Miller <[email protected]>
  14. Signed-off-by: Andrew Morton <[email protected]>
  15. ---
  16. drivers/ssb/main.c | 2 ++
  17. include/linux/ssb/ssb.h | 2 +-
  18. 2 files changed, 3 insertions(+), 1 deletion(-)
  19. --- a/drivers/ssb/main.c
  20. +++ b/drivers/ssb/main.c
  21. @@ -485,6 +485,7 @@ static int ssb_devices_register(struct s
  22. #ifdef CONFIG_SSB_PCIHOST
  23. sdev->irq = bus->host_pci->irq;
  24. dev->parent = &bus->host_pci->dev;
  25. + sdev->dma_dev = dev->parent;
  26. #endif
  27. break;
  28. case SSB_BUSTYPE_PCMCIA:
  29. @@ -500,6 +501,7 @@ static int ssb_devices_register(struct s
  30. break;
  31. case SSB_BUSTYPE_SSB:
  32. dev->dma_mask = &dev->coherent_dma_mask;
  33. + sdev->dma_dev = dev;
  34. break;
  35. }
  36. --- a/include/linux/ssb/ssb.h
  37. +++ b/include/linux/ssb/ssb.h
  38. @@ -167,7 +167,7 @@ struct ssb_device {
  39. * is an optimization. */
  40. const struct ssb_bus_ops *ops;
  41. - struct device *dev;
  42. + struct device *dev, *dma_dev;
  43. struct ssb_bus *bus;
  44. struct ssb_device_id id;