ssb: Fix coherent DMA mask for PCI devices
authorMichael Buesch <mb@bu3sch.de>
Thu, 12 Jun 2008 13:33:13 +0000 (15:33 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 13 Jun 2008 20:14:52 +0000 (16:14 -0400)
This fixes setting the coherent DMA mask for PCI devices.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/ssb/main.c

index 7cf8851286b54a7592412510a0130dc86e626bfe..d184f2aea78d1f0a4b2e2df05c5d79bf8d4a75d9 100644 (file)
@@ -1168,15 +1168,21 @@ EXPORT_SYMBOL(ssb_dma_translation);
 int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask)
 {
        struct device *dma_dev = ssb_dev->dma_dev;
+       int err = 0;
 
 #ifdef CONFIG_SSB_PCIHOST
-       if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI)
-               return dma_set_mask(dma_dev, mask);
+       if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI) {
+               err = pci_set_dma_mask(ssb_dev->bus->host_pci, mask);
+               if (err)
+                       return err;
+               err = pci_set_consistent_dma_mask(ssb_dev->bus->host_pci, mask);
+               return err;
+       }
 #endif
        dma_dev->coherent_dma_mask = mask;
        dma_dev->dma_mask = &dma_dev->coherent_dma_mask;
 
-       return 0;
+       return err;
 }
 EXPORT_SYMBOL(ssb_dma_set_mask);