diff options
author | Michael Buesch <mb@bu3sch.de> | 2008-04-11 05:59:00 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-04-15 15:04:35 -0400 |
commit | 4ac58469f13028e1eb97f8bc7b0fca5072591d8d (patch) | |
tree | c955e1b753e1f86c570d2d6f5f6095d1182d5c35 /drivers/ssb | |
parent | 2d4543fdb487b1301ae48703dea3e66ead2d3c75 (diff) |
ssb: Fix usage of struct device used for DMAing
This fixes DMA on architectures where DMA is nontrivial, like PPC64.
We must use the host-device's (PCI) struct device for any DMA
operation instead of the SSB device. For this we add a new
struct device pointer to the SSB device structure that will always
point to the right device for DMAing.
Without this patch b43 and b44 drivers won't work on complex-DMA
architectures, that for example need dev->archdata for DMA operations.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb')
-rw-r--r-- | drivers/ssb/main.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c index 72017bf2e577..8003a9e55ac4 100644 --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c | |||
@@ -436,15 +436,18 @@ static int ssb_devices_register(struct ssb_bus *bus) | |||
436 | #ifdef CONFIG_SSB_PCIHOST | 436 | #ifdef CONFIG_SSB_PCIHOST |
437 | sdev->irq = bus->host_pci->irq; | 437 | sdev->irq = bus->host_pci->irq; |
438 | dev->parent = &bus->host_pci->dev; | 438 | dev->parent = &bus->host_pci->dev; |
439 | sdev->dma_dev = &bus->host_pci->dev; | ||
439 | #endif | 440 | #endif |
440 | break; | 441 | break; |
441 | case SSB_BUSTYPE_PCMCIA: | 442 | case SSB_BUSTYPE_PCMCIA: |
442 | #ifdef CONFIG_SSB_PCMCIAHOST | 443 | #ifdef CONFIG_SSB_PCMCIAHOST |
443 | sdev->irq = bus->host_pcmcia->irq.AssignedIRQ; | 444 | sdev->irq = bus->host_pcmcia->irq.AssignedIRQ; |
444 | dev->parent = &bus->host_pcmcia->dev; | 445 | dev->parent = &bus->host_pcmcia->dev; |
446 | sdev->dma_dev = &bus->host_pcmcia->dev; | ||
445 | #endif | 447 | #endif |
446 | break; | 448 | break; |
447 | case SSB_BUSTYPE_SSB: | 449 | case SSB_BUSTYPE_SSB: |
450 | sdev->dma_dev = dev; | ||
448 | break; | 451 | break; |
449 | } | 452 | } |
450 | 453 | ||
@@ -1018,15 +1021,14 @@ EXPORT_SYMBOL(ssb_dma_translation); | |||
1018 | 1021 | ||
1019 | int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask) | 1022 | int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask) |
1020 | { | 1023 | { |
1021 | struct device *dev = ssb_dev->dev; | 1024 | struct device *dma_dev = ssb_dev->dma_dev; |
1022 | 1025 | ||
1023 | #ifdef CONFIG_SSB_PCIHOST | 1026 | #ifdef CONFIG_SSB_PCIHOST |
1024 | if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI && | 1027 | if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI) |
1025 | !dma_supported(dev, mask)) | 1028 | return dma_set_mask(dma_dev, mask); |
1026 | return -EIO; | ||
1027 | #endif | 1029 | #endif |
1028 | dev->coherent_dma_mask = mask; | 1030 | dma_dev->coherent_dma_mask = mask; |
1029 | dev->dma_mask = &dev->coherent_dma_mask; | 1031 | dma_dev->dma_mask = &dma_dev->coherent_dma_mask; |
1030 | 1032 | ||
1031 | return 0; | 1033 | return 0; |
1032 | } | 1034 | } |