diff options
-rw-r--r-- | drivers/ssb/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c index d831a2beff39..87ab2443e66d 100644 --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c | |||
@@ -1165,15 +1165,19 @@ EXPORT_SYMBOL(ssb_dma_translation); | |||
1165 | 1165 | ||
1166 | int ssb_dma_set_mask(struct ssb_device *dev, u64 mask) | 1166 | int ssb_dma_set_mask(struct ssb_device *dev, u64 mask) |
1167 | { | 1167 | { |
1168 | #ifdef CONFIG_SSB_PCIHOST | ||
1168 | int err; | 1169 | int err; |
1170 | #endif | ||
1169 | 1171 | ||
1170 | switch (dev->bus->bustype) { | 1172 | switch (dev->bus->bustype) { |
1171 | case SSB_BUSTYPE_PCI: | 1173 | case SSB_BUSTYPE_PCI: |
1174 | #ifdef CONFIG_SSB_PCIHOST | ||
1172 | err = pci_set_dma_mask(dev->bus->host_pci, mask); | 1175 | err = pci_set_dma_mask(dev->bus->host_pci, mask); |
1173 | if (err) | 1176 | if (err) |
1174 | return err; | 1177 | return err; |
1175 | err = pci_set_consistent_dma_mask(dev->bus->host_pci, mask); | 1178 | err = pci_set_consistent_dma_mask(dev->bus->host_pci, mask); |
1176 | return err; | 1179 | return err; |
1180 | #endif | ||
1177 | case SSB_BUSTYPE_SSB: | 1181 | case SSB_BUSTYPE_SSB: |
1178 | return dma_set_mask(dev->dev, mask); | 1182 | return dma_set_mask(dev->dev, mask); |
1179 | default: | 1183 | default: |
@@ -1188,6 +1192,7 @@ void * ssb_dma_alloc_consistent(struct ssb_device *dev, size_t size, | |||
1188 | { | 1192 | { |
1189 | switch (dev->bus->bustype) { | 1193 | switch (dev->bus->bustype) { |
1190 | case SSB_BUSTYPE_PCI: | 1194 | case SSB_BUSTYPE_PCI: |
1195 | #ifdef CONFIG_SSB_PCIHOST | ||
1191 | if (gfp_flags & GFP_DMA) { | 1196 | if (gfp_flags & GFP_DMA) { |
1192 | /* Workaround: The PCI API does not support passing | 1197 | /* Workaround: The PCI API does not support passing |
1193 | * a GFP flag. */ | 1198 | * a GFP flag. */ |
@@ -1195,6 +1200,7 @@ void * ssb_dma_alloc_consistent(struct ssb_device *dev, size_t size, | |||
1195 | size, dma_handle, gfp_flags); | 1200 | size, dma_handle, gfp_flags); |
1196 | } | 1201 | } |
1197 | return pci_alloc_consistent(dev->bus->host_pci, size, dma_handle); | 1202 | return pci_alloc_consistent(dev->bus->host_pci, size, dma_handle); |
1203 | #endif | ||
1198 | case SSB_BUSTYPE_SSB: | 1204 | case SSB_BUSTYPE_SSB: |
1199 | return dma_alloc_coherent(dev->dev, size, dma_handle, gfp_flags); | 1205 | return dma_alloc_coherent(dev->dev, size, dma_handle, gfp_flags); |
1200 | default: | 1206 | default: |
@@ -1210,6 +1216,7 @@ void ssb_dma_free_consistent(struct ssb_device *dev, size_t size, | |||
1210 | { | 1216 | { |
1211 | switch (dev->bus->bustype) { | 1217 | switch (dev->bus->bustype) { |
1212 | case SSB_BUSTYPE_PCI: | 1218 | case SSB_BUSTYPE_PCI: |
1219 | #ifdef CONFIG_SSB_PCIHOST | ||
1213 | if (gfp_flags & GFP_DMA) { | 1220 | if (gfp_flags & GFP_DMA) { |
1214 | /* Workaround: The PCI API does not support passing | 1221 | /* Workaround: The PCI API does not support passing |
1215 | * a GFP flag. */ | 1222 | * a GFP flag. */ |
@@ -1220,6 +1227,7 @@ void ssb_dma_free_consistent(struct ssb_device *dev, size_t size, | |||
1220 | pci_free_consistent(dev->bus->host_pci, size, | 1227 | pci_free_consistent(dev->bus->host_pci, size, |
1221 | vaddr, dma_handle); | 1228 | vaddr, dma_handle); |
1222 | return; | 1229 | return; |
1230 | #endif | ||
1223 | case SSB_BUSTYPE_SSB: | 1231 | case SSB_BUSTYPE_SSB: |
1224 | dma_free_coherent(dev->dev, size, vaddr, dma_handle); | 1232 | dma_free_coherent(dev->dev, size, vaddr, dma_handle); |
1225 | return; | 1233 | return; |